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

Annotate images with version control information by default #366

Open
imjasonh opened this issue May 18, 2021 · 3 comments
Open

Annotate images with version control information by default #366

imjasonh opened this issue May 18, 2021 · 3 comments

Comments

@imjasonh
Copy link
Member

Similar to (and possibly to be built upon) golang/go#37475

Images built by ko can automatically be annotated with information about the commit of the source the image was built from. This would help tie the image to the source that created it. This information would include the commit digest, and whether there are any additional uncommitted changes on top of that commit (a "dirty bit").

golang/go#37475 proposes adding this metadata to Go binaries themselves, whereupon ko could inspect and extract this information. I don't think ko should duplicate this logic itself, especially if Go wants to do it for us.

We should consider some way to disable the annotation, if users don't want to include it for some reason, or possibly just document that we will set it, and that users should scrub this information if they want to.

@jonjohnsonjr
Copy link
Collaborator

SGTM. We can use the same thing to annotate with ko version info.

@imjasonh
Copy link
Member Author

See #221

@imjasonh
Copy link
Member Author

golang/go#37475 is now implemented, and should be released with Go 1.18. After that, we can have ko check for the existence of stamped vcs information in the built binary, and add annotations/labels to the image by default.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants