Skip to content
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

Taskrun's taskref setting kind but without apiversion should be considered as validation error #6557

Open
Yongxuanzhang opened this issue Apr 19, 2023 · 3 comments
Labels
kind/bug Categorizes issue or PR as related to a bug. lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed.

Comments

@Yongxuanzhang
Copy link
Member

Expected Behavior

Setting Kind to any non-empty string and APIVersion to an empty string in a Taskrun's TaskRef will be considered a validation error.

Actual Behavior

apiVersion: tekton.dev/v1
kind: TaskRun
metadata:
  name: tr
  namespace: default
spec:
  taskRef:
    kind: Example
    name: foo
status:
  completionTime: "2023-04-19T02:48:40Z"
  conditions:
  - lastTransitionTime: "2023-04-19T02:48:40Z"
    message: 'error when listing tasks for taskRun tr: failed to get task: tasks.tekton.dev
      "foo" not found'
    reason: TaskRunResolutionFailed
    status: "False"
    type: Succeeded
  podName: ""

Steps to Reproduce the Problem

  1. Create this example with kubectl create -f example.yaml
apiVersion: tekton.dev/v1beta1
kind: TaskRun
metadata:
  generateName: tr-
spec:
  taskRef:
    kind: Example
    name: foo

Additional Info

  • Kubernetes version:

    Output of kubectl version:

(paste your output here)
  • Tekton Pipeline version:

    Output of tkn version or kubectl get pods -n tekton-pipelines -l app=tekton-pipelines-controller -o=jsonpath='{.items[0].metadata.labels.version}'

(paste your output here)
@Yongxuanzhang Yongxuanzhang added the kind/bug Categorizes issue or PR as related to a bug. label Apr 19, 2023
@Yongxuanzhang Yongxuanzhang changed the title Taskrun Taskrun's taskref setting kind but without apiversion should be considered as validation error Apr 19, 2023
@Yongxuanzhang
Copy link
Member Author

#6505 only fixes part of the bug, we should fix taskrun's taskref as well.

Yongxuanzhang added a commit to Yongxuanzhang/pipeline that referenced this issue Apr 19, 2023
This commit closes tektoncd#6459. For a customtask reference in a pipelinetask,
if the Kind is non-empty and not "Task" or "ClusterTask", then it should
be a Custom task and api version should be set. If not then validation
webhook should return error. TaskRun's taskRef validation will be
handled separately in tektoncd#6557

Signed-off-by: Yongxuan Zhang [email protected]
Yongxuanzhang added a commit to Yongxuanzhang/pipeline that referenced this issue Apr 20, 2023
This commit closes tektoncd#6459. For a customtask reference in a pipelinetask,
if the Kind is non-empty and not "Task" or "ClusterTask", then it should
be a Custom task and api version should be set. If not then validation
webhook should return error. TaskRun's taskRef validation will be
handled separately in tektoncd#6557

Signed-off-by: Yongxuan Zhang [email protected]
Yongxuanzhang added a commit to Yongxuanzhang/pipeline that referenced this issue Apr 25, 2023
This commit closes tektoncd#6459. For a customtask reference in a pipelinetask,
if the Kind is non-empty and not "Task" or "ClusterTask", then it should
be a Custom task and api version should be set. If not then validation
webhook should return error. TaskRun's taskRef validation will be
handled separately in tektoncd#6557

Signed-off-by: Yongxuan Zhang [email protected]
tekton-robot pushed a commit that referenced this issue Apr 25, 2023
This commit closes #6459. For a customtask reference in a pipelinetask,
if the Kind is non-empty and not "Task" or "ClusterTask", then it should
be a Custom task and api version should be set. If not then validation
webhook should return error. TaskRun's taskRef validation will be
handled separately in #6557

Signed-off-by: Yongxuan Zhang [email protected]
EmmaMunley pushed a commit to EmmaMunley/pipeline that referenced this issue Apr 28, 2023
This commit closes tektoncd#6459. For a customtask reference in a pipelinetask,
if the Kind is non-empty and not "Task" or "ClusterTask", then it should
be a Custom task and api version should be set. If not then validation
webhook should return error. TaskRun's taskRef validation will be
handled separately in tektoncd#6557

Signed-off-by: Yongxuan Zhang [email protected]
@lbernick lbernick added this to the Pipeline v1 milestone Jun 30, 2023
@tekton-robot
Copy link
Collaborator

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale with a justification.
Stale issues rot after an additional 30d of inactivity and eventually close.
If this issue is safe to close now please do so with /close with a justification.
If this issue should be exempted, mark the issue as frozen with /lifecycle frozen with a justification.

/lifecycle stale

Send feedback to tektoncd/plumbing.

@tekton-robot tekton-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Sep 28, 2023
@tekton-robot
Copy link
Collaborator

Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten with a justification.
Rotten issues close after an additional 30d of inactivity.
If this issue is safe to close now please do so with /close with a justification.
If this issue should be exempted, mark the issue as frozen with /lifecycle frozen with a justification.

/lifecycle rotten

Send feedback to tektoncd/plumbing.

@tekton-robot tekton-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Oct 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug. lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed.
Projects
None yet
Development

No branches or pull requests

3 participants