-
Notifications
You must be signed in to change notification settings - Fork 1.7k
feat: allow ValuesFile from GCS #9182
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
Conversation
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
@JeromeJu can you review this one? |
@JeromeJu can you review this one? Please let me know if any other action is to be taken care. |
|
||
//if the file starts with gs:// then download it in tmp dir | ||
if strings.HasPrefix(v, gcsPrefix) { | ||
tempDir, err := os.MkdirTemp("", valueFileFromGCS) |
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.
the condition's body can be extracted for better readability
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.
Thanks for the suggestion, yes separated to the new function.
pkg/skaffold/helm/args.go
Outdated
tempValueFile = filepath.Join(tempDir, path.Base(v)) | ||
|
||
gcs := gcs.Gsutil{} | ||
if err := gcs.Copy(context.Background(), v, tempValueFile, false); err != nil { |
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.
why context.Background()
, but not TODO()
?
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 updated to TODO()
as it requires the context temporarily
tempValueFile := v | ||
|
||
//if the file starts with gs:// then download it in tmp dir | ||
if strings.HasPrefix(v, gcsPrefix) { |
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.
it looks like it'll be better to contribute to the helm repository
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.
Skaffold has already been integrated with GCP, so I thought to make the change here.
@idsulik can you review this? |
@ashokhein I did it, you need to wait for the maintainers |
@Darien-Lin Can you please review this code? |
Can you add tests for this? Im going to talk with the team, as this seems to have implications that might be unexpected. Findings: Cloud Deploy works with local files only and will not be able to take advantage of referencing gs buckets. However, it already cannot take advantage of gs buckets for other files like raw manifests. This should be a no-op for Cloud Deploy. Or at least, should behave consistently with the other fields that reference gs uris. |
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.
Thank you for adding the tests. I have started the presubmits for this PR.
Can you please address the linting issues found by the linter? Thanks for the contribution!
I fixed that linting issue. Thank you. |
Fixes: #9172
Description
Allow to reference the ValuesFile from Google Storage Bucket. It uses the gsutil to copy the remote file and, put it in the temporary directory and reference it in the helm flags.