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

Is the retries count for Task without validation by design? #7778

Closed
l-qing opened this issue Mar 20, 2024 · 0 comments · Fixed by #7836
Closed

Is the retries count for Task without validation by design? #7778

l-qing opened this issue Mar 20, 2024 · 0 comments · Fixed by #7836
Assignees
Labels
kind/bug Categorizes issue or PR as related to a bug.

Comments

@l-qing
Copy link
Contributor

l-qing commented Mar 20, 2024

Expected Behavior

Setting a negative number for the retry field in the task should prompt a validation failure?

Actual Behavior

Currently, if a negative number is set for the retries field in a Task, the pipeline validation passes.

Steps to Reproduce the Problem

  1. TaskRun:
apiVersion: tekton.dev/v1
kind: Task
metadata:
  name: mock-task
spec:
  steps:
    - name: failure
      image: ubuntu
      script: |
        exit 1

---
apiVersion: tekton.dev/v1
kind: TaskRun
metadata:
  name: mock-taskrun
spec:
  taskRef:
    name: mock-task
  timeout: 2m
  retries: -10
  1. Result
apiVersion: tekton.dev/v1
kind: TaskRun
metadata:
  name: mock-taskrun
spec:
  retries: -10
  serviceAccountName: default
  taskRef:
    kind: Task
    name: mock-task
  timeout: 2m0s
status:
  completionTime: "2024-03-20T09:02:31Z"
  conditions:
  - lastTransitionTime: "2024-03-20T09:02:31Z"
    message: '"step-failure" exited with code 1'
    reason: Failed
    status: "False"
    type: Succeeded
  podName: mock-taskrun-pod
  provenance:
    featureFlags:
      AwaitSidecarReadiness: true
      Coschedule: workspaces
      DisableAffinityAssistant: false
      DisableCredsInit: false
      EnableAPIFields: alpha
      EnableArtifacts: false
      EnableCELInWhenExpression: false
      EnableKeepPodOnCancel: false
      EnableParamEnum: false
      EnableProvenanceInStatus: true
      EnableStepActions: false
      EnableTektonOCIBundles: true
      EnforceNonfalsifiability: none
      MaxResultSize: 4096
      RequireGitSSHSecretKnownHosts: false
      ResultExtractionMethod: termination-message
      RunningInEnvWithInjectedSidecars: true
      ScopeWhenExpressionsToTask: false
      SendCloudEventsForRuns: false
      SetSecurityContext: false
      VerificationNoMatchPolicy: ignore
  startTime: "2024-03-20T09:02:25Z"
  steps:
  - container: step-failure
    imageID: docker.io/library/ubuntu@sha256:77906da86b60585ce12215807090eb327e7386c8fafb5402369e421f44eff17e
    name: failure
    terminated:
      containerID: containerd://5b3a330e89f765ccb517a958a91746da1e71789cda24b104e78d3d63c8ca2bd4
      exitCode: 1
      finishedAt: "2024-03-20T09:02:31Z"
      reason: Error
      startedAt: "2024-03-20T09:02:31Z"
    terminationReason: Error
  taskSpec:
    steps:
    - computeResources: {}
      image: ubuntu
      name: failure
      script: |
        exit 1

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.56.2
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