helm: --wait-for-jobs does not fails if job failed

Output of helm version: version.BuildInfo{Version:“v3.5.0”, GitCommit:“32c22239423b3b4ba6706d450bd044baffdcf9e6”, GitTreeState:“clean”, GoVersion:“go1.15.6”}

Output of kubectl version: Client Version: version.Info{Major:“1”, Minor:“19”, GitVersion:“v1.19.4”, GitCommit:“d360454c9bcd1634cf4cc52d1867af5491dc9c5f”, GitTreeState:“archive”, BuildDate:“2020-11-25T13:19:56Z”, GoVersion:“go1.15.5”, Compiler:“gc”, Platform:“linux/amd64”} Server Version: version.Info{Major:“1”, Minor:“18”, GitVersion:“v1.18.8”, GitCommit:“9f2892aab98fe339f3bd70e3c470144299398ace”, GitTreeState:“clean”, BuildDate:“2020-08-13T16:04:18Z”, GoVersion:“go1.13.15”, Compiler:“gc”, Platform:“linux/amd64”}

Cloud Provider/Platform (AKS, GKE, Minikube etc.):

I have this template:

apiVersion: batch/v1
kind: Job
metadata:
  name: backend-tests-job
  labels:
    app-name: tests
    app-service: backend-tests
spec:
  backoffLimit: 0
  template:
    metadata:
      name: backend-tests
    spec:
      restartPolicy: Never
      imagePullSecrets:
        - name: {{ .Values.imagePullSecrets }}

      containers:
      - name: tests
        image: {{.Values.image.repository}}/{{ .Values.appName }}:{{ .Values.appVersion }}
        imagePullPolicy: Always
        command: ["/usr/bin/make"]
        args: ["test", "PYTEST_ARGS=${ARGS}", "VERSION=${VERSION}"]
        env:
          - name: ARGS
            value: {{ .Values.pytestArgs | quote }}
          - name: GG_VERSION
            value: {{ .Values.version | quote }}
        resources:
            {{- toYaml .Values.resources | nindent 12 }}

I installs it with this command: helm install CHART --wait-for-jobs --wait --timeout 10m

Sometimes job failed (because of tests, yeap 😃 ), does not restart (because of backoffLimit: 0) and then helm just… waits. I think that helm should not wait if job failed without any other restarts

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 2
  • Comments: 18 (8 by maintainers)

Commits related to this issue

Most upvoted comments

#9950 fixes this issue for me too 😃