-
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
TEP-0061, Allow custom task to be embedded. #3901
Conversation
Hi @ScrapCodes. Thanks for your PR. I'm waiting for a tektoncd member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
967685d
to
716d12a
Compare
716d12a
to
d06d8dd
Compare
/ok-to-test |
The following is the coverage report on the affected files.
|
@ScrapCodes looks like you haven't run |
To be honest, I would feel more comfortable having the E2E test part of this PR.
Again, I would prefer to have this in the same PR, but I'm ok with having it as a follow-up, as long as we merge both PR as part of the same release.
NIT: Could you add a more high level description on top or the release notes, something along the lines of
Could you keep this block ^^^ together with the release notes? Having two blocks might break the release notes automation. I think it's a good idea to make a call for action, but we could say that "Developers of custom controllers (existing and new), who would like to support embedded spec for their custom task, need to implement the logic required to extract, validate and use the custom task spec from the new As discussed during the API WG and noted by @imjasonh - having validation of the spec via a validating webhook would mean that all validating webhook of all custom tasks would be invoked for each
|
Thanks a lot @ScrapCodes for this, I look forward to this feature! I will review the code today. |
Looks like this robot does not interpret nested backticks. So, removed them. |
@@ -765,6 +767,22 @@ func (c *Reconciler) createRun(ctx context.Context, rprt *resources.ResolvedPipe | |||
}, | |||
} | |||
|
|||
if rprt.PipelineTask.TaskSpec != nil { | |||
j, err := json.Marshal(rprt.PipelineTask.TaskSpec.Spec) |
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.
what happens when spec
is empty here? do we need a check here rprt.PipelineTask.TaskSpec.Spec
?
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.
there is no error for empty spec, in fact a non empty byte sequence is generated. Do you think we should be more defensive here?
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 am trying to think if there is any use case where the spec
could be empty, could this ever be used in any way?
Since this is not producing any error, its safe to go with the way its implemented now and revisit if needed in future.
the changes looks great @ScrapCodes. I am done reviewing the PR and have requested couple of changes. 🙏 One more thing I am not sure about is all the third party changes, without changing the |
4dc118d
to
6fbe435
Compare
The following is the coverage report on the affected files.
|
I am not sure either, they are generated as part of running, |
6fbe435
to
a2d151e
Compare
The following is the coverage report on the affected files.
|
It is now possible to embed the spec of a custom task in a Run resource, whether stand-alone in Run or embedded in a Pipeline. e.g. in a Run using example TaskLoop controller in tektoncd/experimental/task-loop/ apiVersion: tekton.dev/v1alpha1 kind: Run metadata: name: simpletasklooprun spec: params: - name: word value: - jump - land - name: suffix value: ing spec: apiVersion: custom.tekton.dev/v1alpha1 kind: TaskLoop spec: # This is a new field, which comprises of custom-task spec. taskRef: name: simpletask iterateParam: word timeout: 60s retries: 2 1. API changes, This PR adds new APIs i.e. adds a field `Spec EmbeddedRunSpec` to `RunSpec` 2. An embedded task will accepts new field `Spec` with type `runtime.RawExtension` in addition to `ApiVersion` and `Kind` fields of type string (as part of `runtime.TypeMeta`) 3. Validation changes, in addition to adding support for `Run.RunSpec.Spec` the validations will be changed to support "One of `Run.RunSpec.Spec` or `Run.RunSpec.Ref` " only and not both as part of a single API request to kubernetes. Developers of custom controllers (existing and new), who would like to support embedded spec for their custom task, need to implement the logic required to extract, validate and use the custom task spec from the new RunSpec.Spec field. Please review the documentation in docs/runs.md and docs/pipelines.md
a2d151e
to
4e7a9ff
Compare
The following is the coverage report on the affected files.
|
Looks like it is a problem with my local environment. Even after removing those |
Thank you @pritidesai for taking a look. Please take a look again. Thank you @sbwsg ! Thank you @animeshsingh and @Tomcli for all the support 😄 |
thank you for all the changes, please address the validation in a follow up PR. I have updated the PR description to include the issue number and an attempt to fix /lgtm |
thanks @pritidesai for your review |
Thank @pritidesai, for correcting me on this. I have opened a follow-up PR with the validation: #3977 |
We already designed and implemented support for `Timeouts` and `TaskSpec` in `Custom Tasks`. `Timeouts`: - TEP: tektoncd/community#433 - PR: tektoncd#3976 `TaskSpec`: - TEP: https://github.com/tektoncd/community/blob/main/teps/0061-allow-custom-task-to-be-embedded-in-pipeline.md - PR: tektoncd#3901 This item cleans up the todo items in `RunSpec`.
We already designed and implemented support for `Timeouts` and `TaskSpec` in `Custom Tasks`. `Timeouts`: - TEP: tektoncd/community#433 - PR: #3976 `TaskSpec`: - TEP: https://github.com/tektoncd/community/blob/main/teps/0061-allow-custom-task-to-be-embedded-in-pipeline.md - PR: #3901 This item cleans up the todo items in `RunSpec`.
We already designed and implemented support for `Timeouts` and `TaskSpec` in `Custom Tasks`. `Timeouts`: - TEP: tektoncd/community#433 - PR: tektoncd#3976 `TaskSpec`: - TEP: https://github.com/tektoncd/community/blob/main/teps/0061-allow-custom-task-to-be-embedded-in-pipeline.md - PR: tektoncd#3901 This item cleans up the todo items in `RunSpec`.
Changes
TEP-0061, Allow custom task to be embedded
Spec *EmbeddedRunSpec
toRunSpec
Spec
with typeruntime.RawExtension
in addition toApiVersion
andKind
fields of type string (as part ofruntime.TypeMeta
) :Run.RunSpec.Spec
orRun.RunSpec.Ref
" only and not both as part of a single API request to kubernetes.References:
@Tomcli
@pritidesai
@afrittoli
@animeshsingh
/cc @sbwsg @imjasonh
/kind feature
Closes #3682
Submitter Checklist
As the author of this PR, please check off the items in this checklist:
functionality, content, code)
Release Notes