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

podTemplate.tolerations do not et merged between taskRunTemplate and taskRunSpec[] #7127

Open
flokain opened this issue Sep 19, 2023 · 2 comments · May be fixed by #7851
Open

podTemplate.tolerations do not et merged between taskRunTemplate and taskRunSpec[] #7127

flokain opened this issue Sep 19, 2023 · 2 comments · May be fixed by #7851
Assignees
Labels
kind/bug Categorizes issue or PR as related to a bug.

Comments

@flokain
Copy link

flokain commented Sep 19, 2023

Expected Behavior

as documented in merged PR #6862

taskRunTemplate.podTemplate.tolerations and taskRunSpec[].podTemplate.tolerations get merged.

apiVersion: tekton.dev/v1
kind: PipelineRun
spec:
  taskRunSpecs:
  - pipelineTaskName: build-arm64-image
    podTemplate:
      tolerations:
      - effect: PreferNoSchedule
        key: arch
        operator: Equal
        value: arm64
  taskRunTemplate:
    podTemplate:
      tolerations:
      - effect: NoSchedule
        key: pipeline-priority
        operator: Equal
        value: low

should result in

apiVersion: v1
kind: Pod
metadata:
  labels:
    tekton.dev/pipelineTask: build-arm64-image
spec:
  tolerations:
  - effect: PreferNoSchedule
    key: arch
    operator: Equal
    value: arm64
   - effect: NoSchedule
     key: pipeline-priority
     operator: Equal
     value: low

Actual Behavior

apiVersion: v1
kind: Pod
metadata:
  labels:
    tekton.dev/pipelineTask: build-arm64-image
spec:
  tolerations:
  - effect: PreferNoSchedule
    key: arch
    operator: Equal
    value: arm64

Steps to Reproduce the Problem

1.create any pipelineRun with taskRunTemplate.podTemplate.tolerations and taskrunspec[].podTemplate.tolerations set.
2. inspect the pod created for the task that should inherit both tolerations.
3. the pod only has toleration from taskrunspec.podTemplate.tolerations[]

Additional Info

  • Kubernetes version: 1.25.12

    Output of kubectl version:

WARNING: This version information is deprecated and will be replaced with the output from kubectl version --short.  Use --output=yaml|json to get the full version.
Client Version: version.Info{Major:"1", Minor:"25", GitVersion:"v1.25.3", GitCommit:"434bfd82814af038ad94d62ebe59b133fcb50506", GitTreeState:"clean", BuildDate:"2022-10-12T10:57:26Z", GoVersion:"go1.19.2", Compiler:"gc", Platform:"linux/amd64"}
Kustomize Version: v4.5.7
Server Version: version.Info{Major:"1", Minor:"25+", GitVersion:"v1.25.12-eks-2d98532", GitCommit:"0aa16cf4fac4da27b9e9e9ba570b990867f6a3d8", GitTreeState:"clean", BuildDate:"2023-07-28T16:52:04Z", GoVersion:"go1.20.6", Compiler:"gc", Platform:"linux/amd64"}

  • 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.31.2
Chains version: v0.16.0
Pipeline version: v0.47.0
Triggers version: v0.24.0
Dashboard version: v0.35.0
Operator version: v0.67.0

@flokain flokain added the kind/bug Categorizes issue or PR as related to a bug. label Sep 19, 2023
@khrm
Copy link
Contributor

khrm commented Sep 20, 2023

What's meant in that PR is that you won't only get taskRunSpec[].podTemplate set. During the merge, we check for nil in taskRunSpec[].podTemplate.tolerations, it it's nil, then we set it to taskRunTemplate.podTemplate.tolerations.

Do we need a change in behavior? I can create a PR for that.
@vdemeester @pritidesai

@khrm
Copy link
Contributor

khrm commented Sep 20, 2023

/assign @khrm

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
2 participants