ko-build / ko

Build and deploy Go applications
https://ko.build
Apache License 2.0
7.65k stars 401 forks source link

allow setting annotations #1426

Closed seankhliao closed 1 month ago

seankhliao commented 1 month ago

This adds a new build flag for setting annotations on image indexes and manifests. Annotations are no longer copied from the base image. org.opencontainers.image.base.digest and org.opencontainers.image.base.name are always set to the resolved values.

Usage example:

ko build --image-annotation foo=bar,fizz=buzz .

Fixes #1090 Fixes #1090 Fixes #1231 Fixes #1235 Fixes #1395

imjasonh commented 1 month ago

This looks good! I slightly wonder if we should have some mode (possibly default) where labels are just copied to annotations, but I don't feel strongly and this is clearly something that folks want, so let's just do it.

Thanks for this contribution!

afrittoli commented 1 month ago

Cool, thank you!