-
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 labels for tracking objects lineage #199
Add labels for tracking objects lineage #199
Conversation
/ok-to-test |
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.
- we should add an integration test to check the propagation of labels from pipeline to taskrun
- start a spec document showing what labels appear on which objects, an example from serving
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.
Couple of suggestions.
- Along the line of @pivotal-nader-ziada suggestion, consider declaring labels from pipelinerun, taskrun into a constants file. For example in serving component
register.go
holds these labels.
Ref: https://github.com/knative/serving/blob/master/pkg/apis/serving/register.go - I would recommend the label to have prefix
build-pipeline.knative.dev/componentName
to be consistent with other components.
38ff0eb
to
e15669f
Compare
@pivotal-nader-ziada
I made the |
e15669f
to
aa6984a
Compare
thanks for the changes @tanner-bruce /approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: pivotal-nader-ziada, tanner-bruce 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 |
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 great to me!
My only request is can we add something to our docs about this functionality? I'm thinking that using.md might be the best place, we could either:
- Add a troubleshooting section
- Add a "How do I find my objects" or "How do I find my Runs" section or something similar
I'm basically looking for something that just shows users they can use kubectl
commands with these labels to find created objects.
(I'll leave it to @shashwathi or @pivotal-nader-ziada to add the lgtm
when they're ready cuz they've been more involved in this review)
test/pipelinerun_test.go
Outdated
t.Errorf("Expected TaskRun %s to have succeeded but Status is %s", runName, c.Status) | ||
} | ||
|
||
if r.Labels[pipeline.GroupName+pipeline.PipelineRunLabelKey] != hwPipelineRunName { |
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.
whoa, TIL you get the zero value of a type back if it doesn't exist in the map!
+1 for adding some kind of doc showing what labels are available on which objects, similar to the example from serving I mentioned earlier, but maybe add a section in |
aa6984a
to
658fe5c
Compare
Conflicts are fixed and docs added. |
```shell | ||
kubectl get builds --all-namespaces -l pipeline.knative.dev/pipeline=build-image | ||
``` |
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.
excelleeeeeent thanks for adding these docs!
wat is this just a flake? maybe we should look into it :S |
/test pull-knative-build-pipeline-integration-tests |
/lgtm Remove if you are ready: |
Adds labels to TaskRuns created by PipelineRuns as well as Builds that are created. In TaskRuns and Builds will have labels set telling which Pipeline, PipelineRun and TaskRun are the owners of it. This is useful when doing filtering in searches. Fixes tektoncd#69
658fe5c
to
c9540c5
Compare
The following is the coverage report on pkg/.
|
/lgtm |
/hold cancel not sure why there is a hold still |
Add nightly tektoncd-pipeline
Adds labels to TaskRuns created by PipelineRuns as well as Builds that
are created. In TaskRuns and Builds will have labels set telling which
Pipeline, PipelineRun and TaskRun are the owners of it.
This is useful when doing filtering in searches.
Fixes #69