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

fix(ko): Ko builder push vs load behavior #8845

Merged
merged 1 commit into from
Jun 2, 2023

Conversation

halvards
Copy link
Contributor

@halvards halvards commented Jun 2, 2023

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, the build image should be loaded into the Docker daemon, regardless of the values of the Push and Local fields. In fairness, the comment on LocalDomain says "Use with Local=true." 😃. For reference, the implementation of this behavior is in ko's makePublisher() function.

This change ensures that Skaffold only sets the LocalDomain field for images that should be loaded.

Fixes: #8760 #8786
Related: ko-build/ko#820

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
Copy link

codecov bot commented Jun 2, 2023

Codecov Report

Merging #8845 (f0818de) into main (290280e) will decrease coverage by 6.53%.
The diff coverage is 50.00%.

@@            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     
Impacted Files Coverage Δ
cmd/skaffold/app/cmd/completion.go 13.04% <0.00%> (-1.25%) ⬇️
cmd/skaffold/app/cmd/config/list.go 65.21% <ø> (ø)
cmd/skaffold/app/cmd/config/set.go 88.72% <ø> (ø)
cmd/skaffold/app/cmd/config/util.go 54.28% <ø> (ø)
cmd/skaffold/app/cmd/credits.go 100.00% <ø> (ø)
cmd/skaffold/app/cmd/credits/export.go 0.00% <0.00%> (ø)
cmd/skaffold/app/cmd/deploy.go 40.90% <0.00%> (-12.94%) ⬇️
cmd/skaffold/app/cmd/generate_pipeline.go 60.00% <ø> (ø)
cmd/skaffold/app/cmd/inspect_modules.go 65.00% <ø> (ø)
cmd/skaffold/app/cmd/inspect_profiles.go 66.66% <ø> (ø)
... and 40 more

... and 409 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@ericzzzzzzz ericzzzzzzz merged commit d219498 into GoogleContainerTools:main Jun 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2.4.0 - ko builder fails to cache with docker, does not push image
2 participants