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

Don't set image.base.name if base is specified by digest #408

Merged
merged 5 commits into from
Aug 11, 2021

Conversation

imjasonh
Copy link
Member

@imjasonh imjasonh commented Aug 4, 2021

Based on conversation in google/go-containerregistry#1098

@imjasonh imjasonh requested a review from jonjohnsonjr August 4, 2021 16:44
@google-cla google-cla bot added the cla: yes label Aug 4, 2021
pkg/build/gobuild.go Outdated Show resolved Hide resolved
@jonjohnsonjr
Copy link
Collaborator

Instead of doing this in two places, you could capture the resulting build.Result from this block (as a separate function): https://github.com/google/ko/blob/4ff83080866f8acd0aba662c628eb69b8f9b940d/pkg/build/gobuild.go#L866-L881

And then just mutate.Annotations it in one place.

This is possible because build.Result: https://github.com/google/ko/blob/a85cfeb2041e2635735bf35eca59ab82eed8ad14/pkg/build/build.go#L47-L53

Is compatible with mutate.Annotatable: https://github.com/google/go-containerregistry/blob/a65a0a616b77e0460c5b4b999d3afc346e2d21af/pkg/v1/mutate/mutate.go#L119-L121

And publishers will have to do the casting themselves downstream.

@imjasonh
Copy link
Member Author

imjasonh commented Aug 4, 2021

Man that's nice. Good call 👍

@codecov-commenter
Copy link

Codecov Report

Merging #408 (2fcb7f3) into main (4ff8308) will increase coverage by 0.03%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #408      +/-   ##
==========================================
+ Coverage   42.10%   42.13%   +0.03%     
==========================================
  Files          35       35              
  Lines        1805     1806       +1     
==========================================
+ Hits          760      761       +1     
  Misses        906      906              
  Partials      139      139              
Impacted Files Coverage Δ
pkg/build/gobuild.go 56.57% <100.00%> (+0.09%) ⬆️

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 4ff8308...2fcb7f3. Read the comment docs.

@imjasonh imjasonh merged commit 86a7b6f into ko-build:main Aug 11, 2021
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.

3 participants