-
Notifications
You must be signed in to change notification settings - Fork 222
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
TEP-0106: Support Specifying Metadata per Task in Runtime #695
TEP-0106: Support Specifying Metadata per Task in Runtime #695
Conversation
/assign @vdemeester |
63e08ca
to
bd6d894
Compare
The design doc is not shared with the tekton-dev / tekton-users google groups as I don't have access to it. |
updated the access. sry for this. @afrittoli |
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 this.
I only have a small comment on preventing the use of *.tekton.dev labels and annotations, otherwise it looks good!
## References | ||
|
||
- The related [Tekton Pipeline Issue #4105](https://github.com/tektoncd/pipeline/issues/4105) | ||
- Design Doc [Support Specifying Metadata per Task in Runtime](https://docs.google.com/document/d/1JyeE_TEKDpnqr1uygxkALJyPKXMOypAwPfnEAx7HKyY/edit?usp=sharing) |
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 should be shared with the tekton community
The proposed order will be as (the addition marked with +[]): | ||
|
||
```markdown | ||
+[PipelineTaskRunSpec (of PipelineRun)] > PipelineRun (metadata field) -> TaskRun (metadata field) > TaskSpec (of PipelineTask in Pipeline type) |
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 looks good. We might want to prevent overriding of Tekton defined labels and annotations though.
For instance, in this example:
apiVersion: tekton.dev/v1beta1
kind: TaskRun
metadata:
annotations:
chains.tekton.dev/retries: "3"
chains.tekton.dev/signed: failed.
pipeline.tekton.dev/affinity-assistant: affinity-assistant-24428a19af
pipeline.tekton.dev/release: 6b5710c
results.tekton.dev/record: default/results/5ffb52cc-ce6f-466b-8ddf-827b955cf6c5/records/43f5e888-b935-4264-91c2-7ff54fd09b3e
results.tekton.dev/result: default/results/5ffb52cc-ce6f-466b-8ddf-827b955cf6c5
labels:
tekton.dev/memberOf: tasks
tekton.dev/pipeline: catalog-publish
tekton.dev/pipelineRun: publish-catalog-tekton-ghn4b
tekton.dev/pipelineTask: git-clone
tekton.dev/task: git-clone
triggers.tekton.dev/eventlistener: tekton-cd
triggers.tekton.dev/trigger: catalog
triggers.tekton.dev/triggers-eventid: 5ffb52cc-ce6f-466b-8ddf-827b955cf6c5
- pipeline.tekton.dev annotations are set by the pipeline controller
- chains.tekton.dev annotations are set by chains
- results.tekton.dev annotations are set by results
- tekton.dev labels are set by the pipeline controller or coming from the catalog
- triggers.tekton.dev labels are set by triggers
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.
good catch, thanks Andrea! thinking where do we do the validation(check if overwriting the Tekton metadata) on current logic?
working on my changes with this fuc, perhaps also could be a place which needs to ensure "not overwriting tekton metadata" right
https://github.com/tektoncd/pipeline/blob/d5ae54ac4d978a142ad1ddd26921bb761dd0bfff/pkg/reconciler/pipelinerun/pipelinerun.go#L1010
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.
if validation logic exists on current code, think I can do this to prevent the overwriting:
- add the similar validation on the added field, so the tekton overwritten metadata can't be inputed
- keep changes (populating metadata with the mentioned precedence) in the
combineTaskRunAndTaskSpecAnnotations()
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 thought tektoncd/pipeline#4366 had been implemented but in fact it's still open - in which case I would say we don't need to implement it here - yet.
When we implement the restriction, we will update the runtime metadata.
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.
thanks this context. I will update this point into TEP and mark a follow-up action to revisit this work after the constraint is applied. (also let me update the linked context in that issue)
Add Design Details, Clean Comments Improve Idea Expression Add Note for a Possible Feature Add Section for Metadata Precedence
bd6d894
to
a1d25de
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
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: afrittoli, dibyom, 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 |
API WG - @austinzhao-go to address the conflict concern in the follow up PR, this is in proposed state and ready to merge. Issue - tektoncd/pipeline#4366 /lgtm |
The Related Issue
Design Doc
Implementation PR:
Original PR was closed due to merge commits affecting a squash-down