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

Unexpected Default ‘kind’ in taskRef When Using Resolver in Tekton Pipelines #7762

Closed
l-qing opened this issue Mar 17, 2024 · 1 comment · Fixed by #7763
Closed

Unexpected Default ‘kind’ in taskRef When Using Resolver in Tekton Pipelines #7762

l-qing opened this issue Mar 17, 2024 · 1 comment · Fixed by #7763
Assignees
Labels
kind/bug Categorizes issue or PR as related to a bug.

Comments

@l-qing
Copy link
Contributor

l-qing commented Mar 17, 2024

Expected Behavior

When using a resolver to reference a Task in Tekton Pipeline, the taskRef should not automatically have a default kind type value set as the Task is not applicable in the context of resolvers.

Despite using a resolver to reference a Task, the taskRef still has a default kind type value inserted, which appears to be added by the webhook. This addition seems unnecessary and can cause confusion as it modifies the user’s configuration without a clear purpose within resolver usage.

Actual Behavior

Steps to Reproduce the Problem

  1. Execute the following script
kubectl apply -f - <<EOF
---
apiVersion: tekton.dev/v1
kind: Task
metadata:
  name: test-default-taskref-kind
  namespace: default
spec:
  description: |
    A simple task that prints the date.
  steps:
    - name: echo
      image: bash:latest
      script: |
        #!/usr/bin/env bash
        echo "Hello, world!"
---
apiVersion: tekton.dev/v1
kind: TaskRun
metadata:
  name: test-default-taskref-kind
spec:
  taskRef:
    resolver: cluster
    params:
      - name: kind
        value: task
      - name: name
        value: test-default-taskref-kind
      - name: namespace
        value: default
EOF
  1. The TaskRun
apiVersion: tekton.dev/v1
kind: TaskRun
metadata:
  name: test-default-taskref-kind
spec:
  serviceAccountName: default
  taskRef:
    kind: Task                <- This default value is set
    params:
    - name: kind
      value: task
    - name: name
      value: test-default-taskref-kind
    - name: namespace
      value: default
    resolver: cluster
  timeout: 1h0m0s
status:
  taskSpec:
    description: |
      A simple task that prints the date.
    steps:
    - computeResources: {}
      image: bash:latest
      name: echo
      script: |
        #!/usr/bin/env bash
        echo "Hello, world!"

Additional Info

  • Kubernetes version:

    Output of kubectl version:

Client Version: v1.29.3
Kustomize Version: v5.0.4-0.20230601165947-6ce0bf390ce3
Server Version: v1.28.8
  • 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}'

Client version: 0.35.1
Pipeline version: v0.57.0
@l-qing l-qing added the kind/bug Categorizes issue or PR as related to a bug. label Mar 17, 2024
@l-qing
Copy link
Contributor Author

l-qing commented Mar 17, 2024

/assign @l-qing

l-qing added a commit to l-qing/pipeline that referenced this issue Mar 17, 2024
fix tektoncd#7762

Do not set default kind when taskRef resolver is present,
keep the original configuration of the user.
l-qing added a commit to l-qing/pipeline that referenced this issue Mar 18, 2024
fix tektoncd#7762

Do not set default kind when taskRef resolver is present,
keep the original configuration of the user.
l-qing added a commit to l-qing/pipeline that referenced this issue Mar 19, 2024
fix tektoncd#7762

Do not set default kind when taskRef resolver is present,
keep the original configuration of the user.
l-qing added a commit to l-qing/pipeline that referenced this issue Mar 19, 2024
fix tektoncd#7762

Do not set default kind when taskRef resolver is present,
keep the original configuration of the user.
l-qing added a commit to l-qing/pipeline that referenced this issue Mar 20, 2024
fix tektoncd#7762

Do not set default kind when taskRef resolver is present,
keep the original configuration of the user.
l-qing added a commit to l-qing/pipeline that referenced this issue Mar 20, 2024
fix tektoncd#7762

Do not set default kind when taskRef resolver is present,
keep the original configuration of the user.
l-qing added a commit to l-qing/pipeline that referenced this issue Mar 21, 2024
fix tektoncd#7762

Do not set default kind when taskRef resolver is present,
keep the original configuration of the user.
l-qing added a commit to l-qing/pipeline that referenced this issue Apr 3, 2024
fix tektoncd#7762

Do not set default kind when taskRef resolver is present,
keep the original configuration of the user.
l-qing added a commit to l-qing/pipeline that referenced this issue Apr 9, 2024
fix tektoncd#7762

Do not set default kind when taskRef resolver is present,
keep the original configuration of the user.
l-qing added a commit to l-qing/pipeline that referenced this issue Apr 13, 2024
fix tektoncd#7762

Do not set default kind when taskRef resolver is present,
keep the original configuration of the user.
l-qing added a commit to l-qing/pipeline that referenced this issue Apr 23, 2024
fix tektoncd#7762

Do not set default kind when taskRef resolver is present,
keep the original configuration of the user.
l-qing added a commit to l-qing/pipeline that referenced this issue Apr 24, 2024
fix tektoncd#7762

Do not set default kind when taskRef resolver is present,
keep the original configuration of the user.
tekton-robot pushed a commit that referenced this issue Apr 25, 2024
fix #7762

Do not set default kind when taskRef resolver is present,
keep the original configuration of the user.
l-qing added a commit to katanomi/pipeline that referenced this issue Apr 29, 2024
fix tektoncd#7762

Do not set default kind when taskRef resolver is present,
keep the original configuration of the user.
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.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant