-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
skaffold init --force supports cases with 1 image and multiple builders #4973
skaffold init --force supports cases with 1 image and multiple builders #4973
Conversation
Codecov Report
@@ Coverage Diff @@
## master #4973 +/- ##
==========================================
- Coverage 72.27% 72.25% -0.02%
==========================================
Files 361 361
Lines 12603 12660 +57
==========================================
+ Hits 9109 9148 +39
- Misses 2821 2833 +12
- Partials 673 679 +6
Continue to review full report at Codecov.
|
Can we update the init docs with the order of preference? |
} | ||
|
||
d.builderImagePairs = append(d.builderImagePairs, BuilderImagePair{Builder: choice, ImageName: image}) | ||
d.unresolvedImages = util.RemoveFromSlice(d.unresolvedImages, image) |
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.
should unresolvedImages
be a map
instead?
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.
perhaps! Could you explain your thoughts on why it should be?
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.
sorry I missed this comment. A map would have been more efficient for this RemoveFromSlice
behavior.
@tejal29 how would you suggest documenting this without being too verbose? If we say something like "In the case of multiple builders being matched to a single image, the priority is Docker > Jib > Bazel > Buildpacks" I'm worried it might make things really long |
Ah not the output. I meant the Init docs https://skaffold.dev/docs/pipeline-stages/init/. |
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 would prefer to describe the --force
in this PR so change as well as documentation for the change go hand in hand.
Leaving it upto you.
} | ||
|
||
d.builderImagePairs = append(d.builderImagePairs, BuilderImagePair{Builder: choice, ImageName: image}) | ||
d.unresolvedImages = util.RemoveFromSlice(d.unresolvedImages, image) |
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.
you could set d.unresolvedImages
to empty array instead of calling RemoveFromSlice
here.
@tejal29 Added a section to the docs, PTAL. I wasn't sure exactly where to place it within the init page |
Looks good! Ship it! |
Fixes #3661
Description
Allows for
skaffold init --force
to work in situations where it detects one image and multiple builders. Previously, the user would see the followingNow, a builder will be chosen with the following priority: Docker > Jib > Bazel > Buildpacks
This ordering was decided upon from input on both #3661 and https://kubernetes.slack.com/archives/CABQMSZA6/p1602786450111700.
Follow-up Work
It would be nice to do something in the case of multiple images and builders. I've opened #4912 to talk about this.