Skip to content
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

Implement pflag slice value interface for image types #5575

Merged

Conversation

sladyn98
Copy link
Contributor

Fixes: #5479

Description

This one fixes #5479

User facing changes (remove if N/A)

@sladyn98 sladyn98 requested a review from a team as a code owner March 18, 2021 18:13
@google-cla google-cla bot added the cla: yes label Mar 18, 2021
cmd/skaffold/app/flags/image.go Outdated Show resolved Hide resolved
cmd/skaffold/app/flags/image.go Outdated Show resolved Hide resolved
sladyn98 and others added 2 commits March 19, 2021 16:34
Co-authored-by: Marlon Gamez <marlongamez@google.com>
@pull-request-size pull-request-size bot added size/M and removed size/S labels Mar 19, 2021
@sladyn98 sladyn98 requested a review from MarlonGamez March 19, 2021 12:52
Copy link
Contributor

@MarlonGamez MarlonGamez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is looking pretty good, I just have some comments about the Replace() function

cmd/skaffold/app/flags/image.go Outdated Show resolved Hide resolved
@sladyn98 sladyn98 requested a review from MarlonGamez March 23, 2021 15:46
Copy link
Member

@briandealwis briandealwis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Skaffold has special defaults handling to workaround spf13/pflag#257 and it currently doesn't support SliceValue, just Value. I was banging on this recently but I haven't gotten a fix in yet. Let me see if I can whip it into shape.

cmd/skaffold/app/flags/image.go Outdated Show resolved Hide resolved
Co-authored-by: Brian de Alwis <bsd@acm.org>
@sladyn98
Copy link
Contributor Author

Skaffold has special defaults handling to workaround spf13/pflag#257 and it currently doesn't support SliceValue, just Value. I was banging on this recently but I haven't gotten a fix in yet. Let me see if I can whip it into shape.

Sure, let me know if you need any help, till then I can help out on some other tickets 👍

Copy link
Contributor

@MarlonGamez MarlonGamez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sladyn98 I believe this should be unblocked now and can be finished up soon!

cmd/skaffold/app/flags/image.go Outdated Show resolved Hide resolved
@briandealwis
Copy link
Member

@sladyn98 hope you don't mind but I merged this with HEAD (which now has the fixes for SliceValue) and fixed up your implementation: SliceValue objects must implement Value too.

@briandealwis briandealwis added kokoro:run runs the kokoro jobs on a PR and removed !! do-not-merge !! labels Apr 13, 2021
@kokoro-team kokoro-team removed the kokoro:run runs the kokoro jobs on a PR label Apr 13, 2021
@codecov
Copy link

codecov bot commented Apr 13, 2021

Codecov Report

Merging #5575 (9c969bc) into master (5e2a4ec) will decrease coverage by 0.00%.
The diff coverage is 56.25%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #5575      +/-   ##
==========================================
- Coverage   70.63%   70.63%   -0.01%     
==========================================
  Files         411      411              
  Lines       15777    15789      +12     
==========================================
+ Hits        11144    11152       +8     
- Misses       3812     3817       +5     
+ Partials      821      820       -1     
Impacted Files Coverage Δ
cmd/skaffold/app/flags/image.go 72.97% <53.33%> (-11.03%) ⬇️
cmd/skaffold/app/cmd/deploy.go 56.52% <100.00%> (ø)
pkg/skaffold/docker/parse.go 84.32% <0.00%> (-1.09%) ⬇️
pkg/skaffold/util/tar.go 56.00% <0.00%> (+5.33%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5e2a4ec...9c969bc. Read the comment docs.

// Set Implements Set() method for pflag interface
func (p *Images) Set(csv string) error {
split := strings.Split(csv, ",")
return p.Replace(split)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I realized that this should be .Append() to maintain compatibility with our previous behaviour where we required used to provide multiple -i flags, one for for each image

@briandealwis briandealwis added the kokoro:run runs the kokoro jobs on a PR label Apr 13, 2021
@kokoro-team kokoro-team removed the kokoro:run runs the kokoro jobs on a PR label Apr 13, 2021
@sladyn98
Copy link
Contributor Author

@briandealwis Hey no worries, let me know if these needs any more action, if not I can pick some more issues to solve in the repo

Copy link
Contributor

@MarlonGamez MarlonGamez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm 👍🏼

@briandealwis briandealwis merged commit bf8685a into GoogleContainerTools:master Apr 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"skaffold deploy --images=" does not support specifying multiple images
4 participants