-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
work on using files assets #3254
Conversation
@justinsb we have an interesting chicken and egg problem. We should be pulling sha values from the staged sha1 files in the file registry, for assest like kubectl. Before a file assest is uploaded the sha1 file does not exist. The use case is where kops is running in an airgapped environment and not running the assests phase. Any ideas on how to handle this properly? Currently I am only using the source sha1 file, and I do not think this will work. Should I try the file registry and then try the source sha location? |
I don't have a great answer for that particular scenario of yours. I'd say kops can easily copy the assets to a mirror location. Maybe then for the actual installation, if you're going to say kops can't read from the source locations, you pretend that the source location is the actual location. I don't know whether that means that you actually install the cluster from the mirror, or maybe you just configure the asset store to read hashes from the target instead of the source. I think the latter but I haven't tried it... |
So what I suggest @chrislovecnm is that you start with the simple case, where the source is available, and then we can add the behaviour for where the source is not available separately. |
5e19a0b
to
8624015
Compare
64f5ca6
to
4eca57e
Compare
530f6b0
to
275a732
Compare
upup/pkg/fi/cloudup/urls.go
Outdated
b = kopsUrl | ||
} | ||
|
||
fileUrl, hash, err := assetBuilder.RemapFileAndSHA(b+file, b+file+".sha1") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you probably want to use filepath.Join
here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not certain it is there, but yes...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Little more complicated to do a url ...
baseUrl, err := url.Parse(baseUrlString)
baseUrl.Path = path.Join(u.baseUrl, file)
s := u.String()
3de15b2
to
8d68702
Compare
@chrislovecnm PR needs rebase |
7476bfe
to
b270bae
Compare
/test pull-kops-e2e-kubernetes-aws |
@chrislovecnm PR needs rebase |
85af765
to
1d37150
Compare
4840faa
to
88d9c1b
Compare
b7d9de8
to
37b3f30
Compare
/hold |
e9362a7
to
8eb2ce3
Compare
File assets and the SHA files are uploaded to the new location. Files when are users uses s3 are upload public read only. The copyfile task uses only the existing SHA value. This PR include major refactoring of the use of URLs. Strings are no longer categnated, but converted into a URL struct and path.Join is utlilized. A new values.go file is included so that we can start refactoring more code out of the "fi" package. A
79878bc
to
7057aaf
Compare
Some small things but I'll send PRs rather than continuing the cycle. /lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: justinsb The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these OWNERS Files:
You can indicate your approval by writing |
/test all [submit-queue is verifying that this PR is safe to merge] |
Automatic merge from submit-queue. |
Basic MVP for file assests.