-
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 ClusterTask new CRD #312
Conversation
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.
Small comments, otherwise looks good ! 👼
docs/Concepts.md
Outdated
@@ -126,6 +126,10 @@ pull in your environment, so we provide a way for you to configure that by edit | |||
the `image`'s value in a configmap named | |||
[`config-entrypoint`](./../config/config-entrypoint.yaml). | |||
|
|||
### ClusterTask | |||
|
|||
Similar to `Tasks` but but with a cluster scope. |
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.
one but
to remove 😅
// TaskStatus does not contain anything because Tasks on their own | ||
// do not have a status, they just hold data which is later used by a | ||
// TaskRun. | ||
type TaskStatus struct { |
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.
🎉
@@ -144,9 +150,10 @@ func ResolvePipelineRun(getTask resources.GetTask, getResource resources.GetReso | |||
|
|||
// Get all the resources that this task will be using, if any | |||
inputs, outputs := getPipelineRunTaskResources(pt.Name, pr) | |||
rtr, err := resources.ResolveTaskResources(&t.Spec, t.Name, inputs, outputs, getResource) | |||
spec := t.TaskSpec() | |||
rtr, err := resources.ResolveTaskResources(&spec, t.TaskMetadata().Name, inputs, outputs, getResource) |
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.
nit: Could we have a t.Name()
function here ? (kind-of a shortcut so, not that important)
- issue 251: tektoncd#251 - new type for ClusterTask - Add kind to TaskRef to differentiate between Task kinds - TaskInterface to be used by controllers, implemeted by Task and ClusterTask - update taskRun and pipelineRun to use TaskInterface - update docs Signed-off-by: Nader Ziada <[email protected]>
334ac69
to
4994de5
Compare
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.
Two small questions otherwise LGTM
config/300-clustertask.yaml
Outdated
metadata: | ||
creationTimestamp: null | ||
labels: | ||
controller-tools.k8s.io: "1.0" |
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 does this do?
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 just copied that from task.yaml
but its left over from when these files were generated and should be removed. will take it out from both
metav1.TypeMeta `json:",inline"` | ||
// +optional | ||
metav1.ListMeta `json:"metadata,omitempty"` | ||
Items []Task `json:"items"` |
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.
[]ClusterTask
?
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.
yes it should be []ClusterTask, will fix that
- added copyright notice to yaml files in config/ - removed labels left over from kubebuilder generation from yaml files - fixed ClusterTask type in list items - add correct optional type in taskRun type Signed-off-by: Nader Ziada <[email protected]>
The following is the coverage report on pkg/.
|
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.
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: pivotal-nader-ziada, vdemeester 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 |
@@ -126,6 +126,11 @@ pull in your environment, so we provide a way for you to configure that by edit | |||
the `image`'s value in a configmap named | |||
[`config-entrypoint`](./../config/config-entrypoint.yaml). | |||
|
|||
### Cluster Task | |||
|
|||
Similar to `Task` but with a cluster-wide scope. Cluster Tasks are available in |
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.
Can we provide some examples of Cluster tasks to users? Like what kind of tasks could be cluster task Vs a normal Task.
Why shdn't all tasks be cluster tasks?
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.
@tejal29 any task can be a ClusterTask, it depends on how operators set up their clusters, if they want their users to just use standard tasks available for everybody in all namespaces, or want users to setup their own. It is similar to ClusterBuildTemplates and BuildTemplates in Build
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.
one thing that i noticed in the most recent user study is that i think we've started mixing some of our using docs into the concepts docs - I'd like to move some of the stuff we've got in concepts.md
out and keep this doc pretty short and sweet, just about the high level concepts
something we can iterate on tho! and i think it might make sense to write up some guidelines on which docs go where 🤔
Fixes: #251
Proposed changes: