-
Notifications
You must be signed in to change notification settings - Fork 28
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
Adds support for img labels and anno. in build create cmd #68
Conversation
/cc @otaviof |
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.
Thank you, solid work. Please correct the handling of values with none or multiple =
characters.
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.
Thank you for the update, looks good now for me. One more small change to the flag name.
hey @sm43 - thanks for the contribution per our PR template at https://github.com/shipwright-io/cli/blob/main/.github/pull_request_template.md we have PR authors craft the release note that should go along with their change ultimately, when my PR #62 merges, our CI will enforce the creation of the release note. But in the interim, and given you are new the project, I took the liberty of assisting you and modifying your PR description for you. Please take a look, and if you think the release note needs modification, please do edit your description accordingly. I'll next take a peek at your changes thanks again |
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 gabemontero
Nice work. I have to admit that I do not know the e2e test framework from this repo good enough. Leaving it to Gabe for a final assessment.
[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 |
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.
ideally we've have e2e tests to go along with this, but I'm good either opening a follow up issue for that, or taking that on if the buildrun stuff does in fact happen soonish
otherwise, a couple of minor suggestions on the help text
@gabemontero Thanks for release notes 🙂 will keep in mind to fill it from next time. |
/hold |
/hold cancel |
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.
I would rather pursue the pflag.Value
approach, so we can keep flags
package responsible for providing a BuildSpec
/BuildRunSpec
without side effects, improved testability and more.
Please consider the changes in #69, and the example usage of flags
package.
This adds support to specify labels and annotation for output image. There are 2 flags added for the `build create` command - output-image-label - output-image-annotation Signed-off-by: Shivam Mukhade <[email protected]>
Thanks @otaviof updated the pr. |
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.
Aside of nit comments, it looks good!
/lgtm
spec := &buildv1alpha1.BuildSpec{Output: buildv1alpha1.Image{ | ||
Labels: map[string]string{}, | ||
}} | ||
c := NewMapValue(spec.Output.Labels) |
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: rename this variable to m
it follows the original type.
run kubectl delete buildruns.shipwright.io --all | ||
} | ||
|
||
@test "shp output image labels and annotation lifecycle" { |
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.
great, thank you!
// Type analogous to the pflag "stringArray" type, where each flag entry will be translated to a | ||
// single array (slice) entry, therefore the comma (",") is accepted as part of the value, as any | ||
// other special character. | ||
func (c *MapValue) Type() string { |
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: rename c
to _
, since it's not in use.
"", | ||
"specify a set of key-value pairs that correspond to labels to set on the output 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.
nit: remove empty line.
This adds support to specify labels and annotation for
output image.
There are 2 flags added for the
build create
commandPart of #66
Signed-off-by: Shivam Mukhade [email protected]
Changes
Submitter Checklist
See the contributor guide
for details on coding conventions, github and prow interactions, and the code review process.
Release Notes