-
Notifications
You must be signed in to change notification settings - Fork 694
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
Show digest of pushed images #1737
Conversation
This looks good to me. Rebasing may bump some things to reassign who should approve this, since the owners changed in a4d580e It'd be great to have tests for some of these binaries, but that's definitely out of scope of this PR. |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: illicitonion The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
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.
Hi @illicitonion !!
I'm curious what's the motivation for this change? Did you want to copy the digest to paste somewhere? compare the digest with some other reference?
container/go/cmd/pusher/pusher.go
Outdated
@@ -121,11 +121,16 @@ func main() { | |||
log.Printf("Destination %s was resolved to %s after stamping.", *dst, stamped) | |||
} | |||
|
|||
digest, err := img.Digest() | |||
if err != nil { | |||
log.Fatalf("Failed to digest image: %v", err) |
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.
nit: in the interest of preserving compatibility, could you make this non-fatal? I don't think there's a case where the digest fails but if it did we can just print the original message
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.
Absolutely - done
👋 🎉
Yeah, we have deployment manifests which list the sha256 of the docker images that should be deployed, and so with this change we can trivially copy&paste / scrape them from logs to put them in our deployment manifests. Without this change, we need to look externally for information from the container registry, which it's nice to avoid needing to do, given we already know the information here :) |
Ah, I think you're just looking for the |
I'm currently using https://github.com/bazelbuild/rules_docker/blob/master/contrib/push-all.bzl which doesn't expose this at the moment. I'm currently just running I guess we'd need to go from one bazel invocation to two, so we could drive building the digest files before/after pushing them? |
This Pull Request has been automatically marked as stale because it has not had any activity for 180 days. It will be closed if no further activity occurs in 30 days. |
This PR was automatically closed because it went 30 days without a reply since it was labeled "Can Close?" |
I've also had to resort to extra steps to retrieve the digest myself, so this is a welcome change. It would be useful IMHO if the printed string was something like |
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.
Approving, but would welcome a slightly different format (see comment above)
Edited to be easier to copy and paste - I didn't want to remove the old text because the label substitution may also be relevant, so I had it do both if the stamped label isn't a digest. |
This is a small change that has made my work/life very easy. thanks for this PR @illicitonion |
No description provided.