fix(ko): Ko builder push vs load behavior#8845
Merged
ericzzzzzzz merged 1 commit intoGoogleContainerTools:mainfrom Jun 2, 2023
Merged
fix(ko): Ko builder push vs load behavior#8845ericzzzzzzz merged 1 commit intoGoogleContainerTools:mainfrom
ericzzzzzzz merged 1 commit intoGoogleContainerTools:mainfrom
Conversation
Ko v0.13.0 introduced a change to the handling of image names when loading images into a Docker daemon (instead of pushing to a registry). Specifically, ko v0.13.0 assumes that if the image repo name matches the [`LocalDomain` field](https://github.com/ko-build/ko/blob/v0.13.0/pkg/commands/options/publish.go#L37), the build image should be loaded into the Docker daemon, regardless of the values of the [`Push` and `Local` fields](https://github.com/ko-build/ko/blob/v0.13.0/pkg/commands/options/publish.go#L52-L56). The implementation of this behavior is in [ko's `makePublisher() function](https://github.com/ko-build/ko/blob/v0.13.0/pkg/commands/resolver.go#L189-L190). This change ensures that Skaffold only sets the `LocalDomain` field for images that should be loaded. Fixes: GoogleContainerTools#8760
Codecov Report
@@ Coverage Diff @@
## main #8845 +/- ##
==========================================
- Coverage 70.48% 63.96% -6.53%
==========================================
Files 515 620 +105
Lines 23150 31458 +8308
==========================================
+ Hits 16317 20121 +3804
- Misses 5776 9833 +4057
- Partials 1057 1504 +447
... and 409 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
ericzzzzzzz
approved these changes
Jun 2, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ko v0.13.0 introduced a change to the handling of image names when loading images into a Docker daemon (instead of pushing to a registry).
Specifically, ko v0.13.0 assumes that if the image repo name matches the
LocalDomainfield, the build image should be loaded into the Docker daemon, regardless of the values of thePushandLocalfields. In fairness, the comment onLocalDomainsays "Use withLocal=true." 😃. For reference, the implementation of this behavior is in ko'smakePublisher()function.This change ensures that Skaffold only sets the
LocalDomainfield for images that should be loaded.Fixes: #8760 #8786
Related: ko-build/ko#820