-
Notifications
You must be signed in to change notification settings - Fork 220
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-0061 Allow custom task to be embedded in pipeline, design. #415
Conversation
e99ee25
to
f1718a9
Compare
lgtm |
2. *e2e tests* Add an e2e test for testing a pipelineRun with custom task embedded. | ||
|
||
3. *documentation* Update documentation on custom tasks, to include embedded spec. Also add the | ||
guide on validation for downstream custom task developers. |
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 would recommend to have it split in two PRs rather than three. (1) Add documentation with a preview
mode (2) Code changes + testing
At the same time, it's great to have it but does not have to be part of the TEP.
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 sounds good to me !
@@ -80,6 +80,7 @@ same namespace create resource. Related issue | |||
|
|||
1. Custom task controllers are to be developed by other parties. Custom task | |||
specification validation by Tektoncd/Pipeline webhooks. | |||
2. Handling `metadata` for embedded custom tasks i.e. `taskSpec`. |
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 do not understand this non-goal here. Please explain a little more.
Also, we already have support for metadata while embedding the task specifications which must be propagated to Run
or TaskRun
:
type EmbeddedTask struct {
// +optional
Metadata PipelineTaskMetadata `json:"metadata,omitempty"`
// TaskSpec is a specification of a task
TaskSpec `json:",inline,omitempty"`
}
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 the question, @pritidesai. I am sorry, metadata is supported but it is limited to the sub-fields Labels
and annotations
type PipelineTaskMetadata struct {
// +optional
Labels map[string]string `json:"labels,omitempty"`
// +optional
Annotations map[string]string `json:"annotations,omitempty"`
}
In the normal creation of a custom task resource object, e.g.:
apiVersion: custom.tekton.dev/v1alpha1
kind: TaskLoop
metadata: # A metadata field e.g. name is supported
name: simpletaskloop
spec:
taskRef:
name: simpletask
iterateParam: word
timeout: 60s
retries: 2
Once we embed a custom task, specifying it's name becomes irrelevant. But, still is it worth noting that we do not support all the metadata subfields?
I can update the non goal with above clarification, or completely remove it if it leads to confusion by stating the obvious.
9346bc5
to
2a08f66
Compare
/assign @pritidesai |
Hi @pritidesai and @sbwsg , I have done a self pass and removed those items that seemed like stating the obvious. Please take a look. There is an opened PR with implementation, tektoncd/pipeline#3901 . Thank you, for helping this work move forward. |
Next, whether it is a `Ref` or a `Spec`, validation logic will ensure, they have | ||
non-empty values for, `APIVersion` and `Kind`. | ||
|
||
Lastly document advice for downstream custom controllers to implement their |
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.
Great addition, thank you.
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: sbwsg 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 |
thanks @ScrapCodes @Tomcli for the patience, sorry missed to review it. Looks great and exciting to have this feature. /lgtm |
Thanks a lot, @pritidesai, @sbwsg and @Tomcli. |
Thank you, @Tomcli, @pritidesai, @sbwsg, @imjasonh, @bobcatfish, @afrittoli and @vdemeester for taking a look !