-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
new command kustomize edit add buildmetadata
#4413
new command kustomize edit add buildmetadata
#4413
Conversation
@natasha41575: This PR has multiple commits, and the default merge method is: merge. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: natasha41575 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 |
eb80b6e
to
2ad6170
Compare
kustomize edit add buildmetadata
1e5e5db
to
d0ac733
Compare
Shall we add the "buildmetadata" to |
Yes we should, I was thinking about doing that in a separate PR but I can add it to this one instead |
d0ac733
to
34d49ae
Compare
3d27412
to
8675dd1
Compare
} | ||
} | ||
return nil | ||
} |
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.
Normally we define the function Validate
to be sharable among setBuildMetadataOptions
, addBuildMetadataOptions
, removeBuildMetadataOptions
? But I can see this may introduces more code structure to kustomize/commands/set
dir. So it defers to you
What we can do to share the code: add a new structure buildMetadataValidator which has the Validate func, and itself is an attribute to the other functions? e.g.
package cmdvalidate // a sub dir under kustomize/commands/internal
type buildMetadataValidator struct {}
func (b *buildMetadataValidator) Validate() {
...
}
type setBuildMetadataOptions struct {
*buildMetadataValidator
buildMetadataOptions []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.
I did this in kustomize/commands/util/validate.go
, because the util package already had some common functions shared among the edit commands. Thanks for the suggestion!
058c639
to
d825e36
Compare
d825e36
to
a6c4710
Compare
/lgtm Looks great! |
This is the last PR needed to finish implementation of the proposal to add origin and transformer annotations [link to KEP].
This adds a command
kustomize edit add buildmetadata
that allows users to edit the buildMetadata options in the kustomization file. It also addskustomize edit set buildmetadata
andkustomize edit remove buildmetadata
commands.E.g.
kustomize edit add buildmetadata managedByLabel
,kustomize edit add buildmetadata originAnnotations,transformerAnnotations
/cc @yuwenma
/cc @KnVerey