-
Notifications
You must be signed in to change notification settings - Fork 202
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 support for labels and annotations in deployment template options #1812
add support for labels and annotations in deployment template options #1812
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Hi @charlesmorin. Thanks for your PR. I'm waiting for a tektoncd member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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. |
@@ -135,6 +135,60 @@ func (ot *OptionsTransformer) updateAnnotations(u *unstructured.Unstructured, an | |||
return nil | |||
} | |||
|
|||
func (ot *OptionsTransformer) updatePodTemplateLabels(u *unstructured.Unstructured, labels map[string]string) error { |
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.
Had to go with NestedMap
, RemoveNestedField
and SetNestedMap
here given there's no method for pod templates in https://github.com/tektoncd/operator/blob/main/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/unstructured/unstructured.go
/ok-to-test |
The following is the coverage report on the affected files.
|
84f31e7
to
a4d5ebe
Compare
The following is the coverage report on the affected files.
|
a4d5ebe
to
194b4b2
Compare
The following is the coverage report on the affected files.
|
194b4b2
to
22e5d84
Compare
The following is the coverage report on the affected files.
|
/retest |
22e5d84
to
c77d4e3
Compare
The following is the coverage report on the affected files.
|
actualLabels[labelKey] = labelValue | ||
} | ||
|
||
if actualLabels == 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.
@charlesmorin actualLabels
never be nil
right? You have already initialized with empty map, if it is nil
actualAnnotations[annotationKey] = annotationValue | ||
} | ||
|
||
if actualAnnotations == 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.
@charlesmorin actualAnnotations
never be nil
right? You have already initialized with empty map, if it is nil
labels: | ||
custom-label: "foo" | ||
annotations: | ||
custom-annotation: "foo" |
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.
can you add the same in the deployments
and statefulSets
documentation?
@charlesmorin: PR needs rebase. 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. |
Changes
spec.template.metatada.labels
andspec.template.metatada.annotations
).Sample
Submitter Checklist
These are the criteria that every PR should meet, please check them off as you
review them:
make test lint
before submitting a PRRelease Notes