-
Notifications
You must be signed in to change notification settings - Fork 113
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
Specify annotations and labels to be set on output images #854
Specify annotations and labels to be set on output images #854
Conversation
Reference shipwright-io#731 Add new image mutate step container, analog to Git step. Update Build spec to add optional annotations and labels. Update TaskRun setup code to add an image mutate step. Co-authored-by: Sascha Schwarze <schwarzs@de.ibm.com>
Co-authored-by: Sascha Schwarze <schwarzs@de.ibm.com>
/kind api-change |
Adding @imjasonh as this implements a ship written by him, Modifying Output Image. Compared to the ship, we made one change in the implementation: we did not use the Before merging this PR, we need to get the new image repository set up in quay.io/shipwright/mutate-image. |
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.
Nice. Please have a look at multiple labels/annotations.
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.
Nice. Two small things. And one more addition we need for completeness:
In build.go, we have the code that validates Builds. Please add another validator for the annotations and labels so that the registration of the Build will fail if the annotation or label value is not correct (misses the =
). You can still retain your current logic when you build the the TaskRun, this does not hurt. But adding this validation upfront for the Build would be nice for our users.
Above was non-sense as the key and value are separated anyway in the map that is being provided in the Build.
df373b0
to
e9ff088
Compare
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.
/approve
/assign imjasonh
@imjasonh we need a second reviewer as it changes the API, and as it is the implementation of your Ship, can you have a look ?
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: SaschaSchwarze0 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
quick sanity check: went back to the EP to refresh my mem, and while it ref'ed the use of To be clear, I don't want to block progress of this PR in any way wrt that, but I wanted to make sure nothing in this PR is locking us into the use of the mutate via crane step. From what I see, that is in fact the case. This PR has not provided a "configure how we mutate" piece of config at this time, but I think that is OK. Seems like we can just add it if we decided to add such a thing, and build of of the new API added here. Lastly, disclaimer: I did not open every resolved conversation to see if this was already discussed. Given that preamble, @SaschaSchwarze0 @shahulsonhal - do you all agree that adding options on how we mutate to add labels / annotations can be easily extended in the future? |
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.
/lgtm
I think we might want to revisit writing and maintaining this code ourselves, but for now it's probably fine. If we find ourselves rebuilding more of crane in this repo we might reconsider.
Thanks for putting this together!
} | ||
|
||
if desc.MediaType.IsIndex() { | ||
return fmt.Errorf("mutating annotations on an index is not yet supported") |
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 might be a reason to prefer just using crane directly. If it doesn't support this already I suspect it will before we add support for it.
Hi @gabemontero, thanks for checking. You refer to this, I think:
I think the larger topic is ...
We do not have any pressure in down stream regarding this feature, so, we can have a broader discussion in a community meeting on this. But in general, I do not see us locked. |
Yes correct @SaschaSchwarze0
Yes there are similarities between the potential plug and play implementation mechanism for labeling / annotating images and the source code upload feature, and what @otaviof and @HeavyWombat are doing there. Perhaps with such overrides and their specifications growing, we capture those centrally vs. specific to each feature. Perhaps something to bring up in an upcoming community meeting, with an eye toward creating an issue for a possible EP in this space.
Understood. Conversely, I could see as we eventually migrate existing openshift build customers to shipwright, where they are use to the savings of getting the annotations/labels in the images build step vs. a separate step, with the need to sign off on an additional But it is not an immediate thing on our end for sure.
Agreed and thanks for the confirmation / follow up. |
Changes
Reference #731
Add new image mutate step container, analog to Git step.
Update Build spec to add optional annotations and labels.
Update TaskRun setup code to add an image mutate step.
Fixes #50
Submitter Checklist
See the contributor guide
for details on coding conventions, github and prow interactions, and the code review process.
Release Notes