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

fix: added check for initContainer name in workflow template #7411

Merged
merged 3 commits into from
Dec 14, 2021

Conversation

dpadhiar
Copy link
Member

#7383

If an initContainer omits the name key, the workflow will immediately fail now.

Example workflow from original issue:

apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
  generateName: spurious-
spec:
  entrypoint: main

  templates:
  - name: main
    dag:
      tasks:
      - name: spurious
        template: spurious

  - name: spurious
    retryStrategy:
      retryPolicy: Always
    initContainers:
    - image: alpine:latest
      # name: sleep
      command:
      - sleep
      - "15"
    container:
      image: alpine:latest
      command:
      - echo
      - "i am running"

Output:

FATA[2021-12-14T11:11:46.032Z] Failed to submit workflow: templates.main.tasks.spurious initContainers must all have container name

Signed-off-by: Dillen Padhiar <dpadhiar@ucsd.edu>
Signed-off-by: Dillen Padhiar <dpadhiar@ucsd.edu>
Copy link
Contributor

@alexec alexec left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One minor change requested. Please dismiss this review once done.

workflow/validate/validate.go Outdated Show resolved Hide resolved
workflow/validate/validate_test.go Show resolved Hide resolved
Signed-off-by: Dillen Padhiar <dpadhiar99@gmail.com>
@alexec
Copy link
Contributor

alexec commented Dec 14, 2021

LGTM

@alexec alexec enabled auto-merge (squash) December 14, 2021 23:18
@alexec alexec merged commit 014bac9 into argoproj:master Dec 14, 2021
@sarabala1979 sarabala1979 mentioned this pull request Dec 15, 2021
73 tasks
sarabala1979 pushed a commit that referenced this pull request Dec 15, 2021
Signed-off-by: Dillen Padhiar <dpadhiar99@gmail.com>
@sarabala1979 sarabala1979 mentioned this pull request Mar 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants