-
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
Clearer Custom Task Reference Interface #6186
Comments
@XinruZhang I am not sure I completely agree with this statement. The |
Thank you for the comment @vdemeester. Sorry for the confusion that I might have introduced here 🙃 My main point is it is confusing for a new Tekton user that using taskRef.apiVersion + taskRef.kind + taskRef.name to refer to a Custom Task. I updated the issue description, added the Use Case section to describe where the confusion is for a Tekton User, and why it is inconsistent, hope this helps with clarifying my idea. Since I'm proposing a new field here, we can consider makeing this API field more generic (remove the implied Kubernetes-ism) as suggested in this conformance design principle to improve our API abstraction. |
@tektoncd/core-collaborators PTAL :) |
Even though apiVersion and kind are technically kubernetes-isms, I think the spirit of the design principle on conformance is to not introduce fields that are only able to run on k8s as opposed to other platforms. I'm not convinced that apiVersion and kind detract from conformance goals because it's extremely likely that custom task users would need to specify this info regardless of platform (I'm assuming that's why it's encoded in the "customTask" syntax in the example above). Also, we can make this an additive change, but it introduces redundancy into the API. I'd imagine we'd consider deprecating the existing syntax at some point. I'm not sure there's a strong enough reason to do this. Maybe to lessen confusion, we could allow the "illegal usage" example above? i.e.
|
Thank you for the comment @lbernick!
An interesting idea emerged when I discussed this with @vdemeester offline, 1. Filtering
For the filtering purpose, we actually don't have to use 2. Get the target CRD resource back and make modifications: For this purpose, the info "APIVersion" and "Kind" is important for those custom task controllers who take care of those CRDs defined within For example, a custom task user can specify: taskRef:
customTask: "PipelineLoop"
name: "my-pipeline-loop" And in the PipelineLoop controller, it can only reconcile resources where their
I partially agree with this statement, for the conformance policy, the functional capability of being platform-ignorant is indeed important, but the naming itself is also important. |
Moving the discussion with @pritidesai here in the issue: the main idea that @pritidesai brings is:
|
Chatted offline with @XinruZhang and we agreed that it's not necessarily the fact that "apiVersion" and "kind" are "kubernetes-isms" that makes them confusing-- what's actually confusing is that custom run controllers reconcile custom run objects, and whether they reconcile objects with the specified api version and kind is entirely up to the controller. We're overloading "kind" to mean both the custom run controller that should reconcile the object and the type of object that the custom run controller can optionally reconcile. Similarly, we're overloading "apiVersion" to mean both the version of the custom spec (where api group is not clearly meaningful) and the api group + version of the object that the controller can optionally reconcile. It's also confusing that name is required for Tasks but optional for custom Tasks. If the custom task controller supports reconciling objects of the same name and api version, it's supposed to look up the object with that name and use its spec, and if the user doesn't specify a name, the custom task controller may support reconciling w/ an empty spec. Imagine a custom run controller must continue to reconcile CustomRuns, but can do so however it wants to (i.e. it's not necessarily required to reconcile objects of the same api version and kind as it filters for). The following syntax would be clearer IMO. (I'm not proposing this syntax, I'm just trying to brainstorm what it would look like if we didn't overload apiversion/kind in this way.)
This signifies that the custom run would be reconciled by the "PipelineLoopFancyController", using its v1 version of the custom spec. This specific custom run controller can either accept a custom spec inline, or it can look up whatever type of objects it reconciles. In this example, it would look up whatever type of object it reconciles, named "my-pipeline-loop-crd", and use that object's spec. (We probably wouldn't allow custom task references in taskref if we did this.) I'm not sure what syntax I'd want for a reference to a custom task in an ideal world, but wanted to hear others' thoughts on this (maybe nobody else finds this confusing?) |
I haven't gotten chance to review the entire thread here, pinging @Tomcli so that Tommy can chime in, thanks! |
I think @XinruZhang's proposal on the |
Issues go stale after 90d of inactivity. /lifecycle stale Send feedback to tektoncd/plumbing. |
Stale issues rot after 30d of inactivity. /lifecycle rotten Send feedback to tektoncd/plumbing. |
Rotten issues close after 30d of inactivity. /close Send feedback to tektoncd/plumbing. |
@tekton-robot: Closing this issue. In response to this:
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. |
Feature Request
Request to have an additive dedicated field for referencing Custom Task, instead of using generally named fields
apiVersion + kind + name
undertaskRef
for it.In this way, we create a new field
customTask
undertaskRef
for referencing Custom Task (just like we have a dedicated fieldresolver
for Remote Resources).Use Case
Say I'm a new comer to Tekton, the first thing I knew about
taskRef
is it refers to aTask
and will be scheduled as aTaskRun
.When I want to use the powerful Custom Task, I realized I need to use the following genaric syntax under
taskRef
to specify a CustomTask reference.What's even more weird is, I'm not allowed to use
taskRef.apiVersion
when specifying a regular Task, which seems like an inconsistent API design.It would be clearer if we have a dedicated field to refer to
CustomTask
s undertaskRef
.The text was updated successfully, but these errors were encountered: