-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
cleaning up label keys 🧹 #4154
cleaning up label keys 🧹 #4154
Conversation
We have defined GroupName as a constant which is set to tekon.dev in register.go. We have other label keys defined in the same go file which are used by the controller to set the appropriate labels. These keys are TaskLabelKey, PipelineLabelKey, etc. These keys are set to "/task", "/pipeline", etc. Now while adding such labels in the tekton resources, we join GroupName to the key. Instead, this commit changes the way we have defined a label key to include GroupName as part of the label key and use just the label key instead of concatinating while using the key. This cleansup the code and makes it simple to add tekton internal labels and retrieve them.
2c0da4f
to
fae594e
Compare
I think it might be worth including a release note for this. If anyone's maintaining their own code that imports and uses these constants from the pipelines codebase then they'll need to be aware of the change. /approve Looks like the integration failure was just a flake. /test pull-tekton-pipeline-integration-tests |
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
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: sbwsg, vdemeester 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 |
Changes
We have defined
GroupName
as a constant which is set totekon.dev
inregister.go
. We have other label keys defined in the same go file which are used by the controller to set the appropriate labels. These keys areTaskLabelKey
,PipelineLabelKey
, etc. These keys are set to"/task"
,"/pipeline"
, etc. Now while adding such labels in the Tektonresources, we join
GroupName
to the constant label key. Instead, this commit changes the way we have defined a label key to includeGroupName
as part of the label key and use just the label key instead of concatenatingGroupName
everywhere. This cleans up the code and makes it simple to add tekton internal labels and at the same time retrieve them.Most of the changes here are done using these two commands:
And I ran a sample pipeline to make sure the labels still have
tekton.dev
🤣This cleanup was motivated while resuming work on #2891 😜
/kind cleanup
Submitter Checklist
As the author of this PR, please check off the items in this checklist:
functionality, content, code)
Release Notes