-
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
Add metadata to PipelineTask to specific additional labels and annotations #2767
Comments
Here are examples of how tasks and pipeline can be embedded:
Yes, it is possible to embed multiple taskSpecs under pipelineSpec which in turn can be embedded under |
Metadata for first example:
Anything missing here? |
@pritidesai -- what we would want is apiVersion: tekton.dev/v1beta1
kind: PipelineRun
metadata:
name: pipelinerun-with-taskspec-to-echo-greetings
spec:
pipelineSpec:
params:
- name: GREETINGS
description: "Greetings, default is Hello World!"
type: string
default: "Hello World!"
tasks:
- name: echo-greetings
taskSpec:
metadata: # <--- ERROR: cannot decode incoming new object: json: unknown field "metadata"
labels:
app: containerOp
params:
- name: MESSAGE
type: string
default: "Hello World!"
steps:
- name: echo
image: ubuntu
script: |
#!/usr/bin/env bash
echo "$(params.MESSAGE)"
But that is just one example. Really this question is about any know capabilities that would get lost when transforming from multiple separate |
Here is my understanding: |
Right,
Pipeline metadata:
CRD metadata is stored inside the resources themselves, in case of embedding resources, no resources are created and hence no metadata. What is your use case? may be we can brainstorm and figure out how to support it |
Is it possible to update the podTemplate so that we can add labels/annotations to taskRun without creating the task CRD? The custom label or annotations are not implemented in podTemplate, but we want to see can we add that support to the podTemplate similar to how ImagePullSecrets was done |
@pritidesai @afrittoli see if this can be prioritized - parts of our implementation definitely dependent on being able to pass lables/annotations at a taskRun level in addition to higher pipelineRun level |
i.e. We want to append the extra pod labels or annotations to here https://github.com/tektoncd/pipeline/blob/master/pkg/pod/pod.go#L259-L260 |
And ideally want it to be part of 0.13 bug-fix or patch, or 0.14 release latest for us to be able to deliver timely. |
@ckadner maybe we can update the issue description to be a little bit more concise for metadata.labels and annotations? The other metadata are irrelevant in Kubeflow and our use case. |
@animeshsingh if I understand correctly, you need to have support for setting different annotations or metadata on the TaskRun created from embedded TaskSpec define in Pipelines (from the Pipeline Label and Annotation), am I right ? I could see having the following:
It should be added on all embedded spec types. It wouldn't break backward compatibility.
A 0.13 bug-fix would definitely be not possible, it's not a bug, it's a new feature to add. /kind feature We should retitle the issue "Add metadata to PipelineTask to specific additional labels and annotations" 👼 🙏 |
Thanks @vdemeester. A 0.14 can land just in time for us - what's the timeframe for cutting it? @ckadner please rename the issue. |
I think the current deadline for 0.14 is on 1st July of 2020 for 0.14 🙃 |
Thanks @vdemeester. That's what we want. |
I think that's a fair ask and doable. cc @bobcatfish @pritidesai @afrittoli |
/remove-kind question |
@vdemeester does it mean introducing
Do we introduce the same
|
@pritidesai That might be a way yes 🙃 We don't necessary need to use
Not sure I follow 😝 both are the same type 🙃 |
/assign |
@pritidesai thanks for tackling this - would love for this to be in master before v0.14 release, which i am hoping comes out some timeframe in July, and is adopted in ibm cloud for us to be able to leverage functionality finally on product side. |
yup, working on a PR as we speak 👍 |
PR #2826 is created to support These labels are commonly used to identify and filter pods for further actions (such as collecting pod metrics, and cleaning up completed pod with certain labels, etc) even being part of one single Pipeline.
|
Update issue title and description on 6/9/2020:
We need to have support for setting different annotations or metadata on the TaskRun created from embedded TaskSpec define in Pipelines (from the Pipeline Label and Annotation), am I right ?
I could see having the following:
It should be added on all embedded spec types. It wouldn't break backward compatibility.
Original Issue Question:
Can any Tekton YAML that contains separate "documents" for
Task
s,Pipeline
,PipelineRun
be converted to a YAML file containing only onePipelineRun
"document" with embeddedpipelineSpec
which embeds multipletaskSpec
s?One thing that seems to get lost are Task
metadata
like pod label annotations.Related issues:
#872
#1333
#1554
Answer from @vdemeester:
The text was updated successfully, but these errors were encountered: