-
Notifications
You must be signed in to change notification settings - Fork 41
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
Add metadata in imgpkg lock file #132
Conversation
e43b985
to
debe17b
Compare
@cari-lynn Requesting review, was unable to select you as a GH reviewer. |
f02e03b
to
c553f0b
Compare
This looks good to me. Great idea extracting out the meta interface into its own package, it really cleaned up nicely :) |
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.
This work is really close.
The overall approach looks really good to me.
Details in the comments, below.
Reviewed w/ @garrettcheadle (offering to make changes if desired):
👍🏻
I'll look into that. |
In terms of prior art, I'm seeing this idiom which attempts to unmarshal data into a set of potential structs... https://github.com/vmware-tanzu/carvel-kbld/blob/f919f7f78a/pkg/kbld/resources/path.go#L78-L91 By the end of the I think we should do a similar thing in the case of detecting which kind of |
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.
(looks like i had review that wasnt submitted. might be a bit stale.)
8aed0e9
to
f593752
Compare
Reviewed w/ @cppforlife over the phone.
|
Signed-off-by: Cari Dean <[email protected]>
Signed-off-by: Garrett Cheadle <[email protected]>
- exclude metas in imgpkg lock when image is given in digest form Signed-off-by: Cari Dean <[email protected]>
- return err from unmarshalling image lock
Signed-off-by: Garrett Cheadle <[email protected]>
- Use custom unmarshaler for image metas - Move Metas from image package to config package - Rename Metas to ImageMetas
- extract meta type names as constants - fix slice append gotcha: when creating a new slice, copy from old first (i.e. copyAndAppendMeta()) - various renames and inlining to improve clarity
dbc497e
to
9e718e6
Compare
- meta are descriptive, not identifying, so they have no bearing on whether two ImageOverrides are equal. Given that all overrides are created brand fresh during a resolve for the kbld lock file, there's no need to dedup them (removed call to UniqueImageOverride()).
9e718e6
to
2c48ce6
Compare
When using the
--imgpkg-lock-output
flag, this PR adds thekbld.carvel.dev/metas
annotation.When using a lock file as input to kbld, this PR also will preserve any
kbld.carvel.dev/metas
. It will append new metas to the list in the output and an imgpkg Lock file. This results in a history for example:Other new behavior:
kbld.carvel.dev/metas
annotation is malformatted, kbld will error.kbld.carvel.dev/metas
annotation must be in the format of several predefined objects, other unknown meta objects will be ignored.