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

--dry-run flag is not respected when submitting from an existing WorkflowTemplate #12944

Open
4 tasks done
Nizar-opt opened this issue Apr 16, 2024 · 1 comment
Open
4 tasks done
Labels
area/cli The `argo` CLI area/workflow-templates P1 High priority. All bugs with >=5 thumbs up that aren’t P0, plus: Any other bugs deemed high priority type/bug

Comments

@Nizar-opt
Copy link

Pre-requisites

  • I have double-checked my configuration
  • I can confirm the issue exists when I tested with :latest
  • I have searched existing issues and could not find a match for this bug
  • I'd like to contribute the fix myself (see contributing guide)

What happened/what did you expect to happen?

What happens:
When a WorkflowTemplate is submitted with a --dry-run or --server-dry-run flag, a workflow is created.

What I expect:
based on argo submit --help:

Flags:
      --dry-run                      modify the workflow on the client-side without creating it
     ...
      --server-dry-run               send request to server with dry-run flag which will modify the workflow without creating it

A workflow should not be created when a WorkflowTemplate is submitted with a --dry-run or --server-dry-run flag.

To Reproduce:

apiVersion: argoproj.io/v1alpha1
kind: WorkflowTemplate
metadata:
  name: workflow-template-submittable
spec:
  entrypoint: whalesay-template
  arguments:
    parameters:
      - name: message
        value: hello world
  templates:
    - name: whalesay-template
      inputs:
        parameters:
          - name: message
      container:
        image: docker/whalesay
        command: [cowsay]
        args: ["{{inputs.parameters.message}}"]

run

argo submit --dry-run --output name --from WorkflowTemplate/workflow-template-submittable

or

argo submit --server-dry-run --output name --from WorkflowTemplate/workflow-template-submittable
argo version
argo: v3.5.5+c80b2e9.dirty
  BuildDate: 2024-02-29T21:30:23Z
  GitCommit: c80b2e91ebd7e7f604e88442f45ec630380effa0
  GitTreeState: dirty
  GitTag: v3.5.5
  GoVersion: go1.22.0
  Compiler: gc
  Platform: linux/amd64

Version

v3.5.5

Paste a small workflow that reproduces the issue. We must be able to run the workflow; don't enter a workflows that uses private images.

apiVersion: argoproj.io/v1alpha1
kind: WorkflowTemplate
metadata:
  name: workflow-template-submittable
spec:
  entrypoint: whalesay-template
  arguments:
    parameters:
      - name: message
        value: hello world
  templates:
    - name: whalesay-template
      inputs:
        parameters:
          - name: message
      container:
        image: docker/whalesay
        command: [cowsay]
        args: ["{{inputs.parameters.message}}"]

Logs from the workflow controller

time="2024-04-16T13:01:22.706Z" level=info msg="Processing workflow" Phase= ResourceVersion=910843641 namespace=argo workflow=workflow-template-submittable-s62f5
time="2024-04-16T13:01:22.729Z" level=info msg="Task-result reconciliation" namespace=argo numObjs=0 workflow=workflow-template-submittable-s62f5
time="2024-04-16T13:01:22.729Z" level=info msg="Updated phase  -> Running" namespace=argo workflow=workflow-template-submittable-s62f5
time="2024-04-16T13:01:22.746Z" level=info msg="Created PDB resource for workflow." namespace=argo workflow=workflow-template-submittable-s62f5
time="2024-04-16T13:01:22.746Z" level=warning msg="Node was nil, will be initialized as type Skipped" namespace=argo workflow=workflow-template-submittable-s62f5
time="2024-04-16T13:01:22.747Z" level=info msg="was unable to obtain node for , letting display name to be nodeName" namespace=argo workflow=workflow-template-submittable-s62f5
time="2024-04-16T13:01:22.747Z" level=info msg="Pod node workflow-template-submittable-s62f5 initialized Pending" namespace=argo workflow=workflow-template-submittable-s62f5
time="2024-04-16T13:01:22.806Z" level=info msg="Created pod: workflow-template-submittable-s62f5 (workflow-template-submittable-s62f5)" namespace=argo workflow=workflow-template-submittable-s62f5
time="2024-04-16T13:01:22.806Z" level=info msg="TaskSet Reconciliation" namespace=argo workflow=workflow-template-submittable-s62f5
time="2024-04-16T13:01:22.806Z" level=info msg=reconcileAgentPod namespace=argo workflow=workflow-template-submittable-s62f5
time="2024-04-16T13:01:22.817Z" level=info msg="Workflow update successful" namespace=argo phase=Running resourceVersion=910843646 workflow=workflow-template-submittable-s62f5
time="2024-04-16T13:01:32.800Z" level=info msg="Processing workflow" Phase=Running ResourceVersion=910843646 namespace=argo workflow=workflow-template-submittable-s62f5
time="2024-04-16T13:01:32.800Z" level=info msg="Task-result reconciliation" namespace=argo numObjs=1 workflow=workflow-template-submittable-s62f5
time="2024-04-16T13:01:32.800Z" level=info msg="task-result changed" namespace=argo nodeID=workflow-template-submittable-s62f5 workflow=workflow-template-submittable-s62f5
time="2024-04-16T13:01:32.800Z" level=info msg="node changed" namespace=argo new.message= new.phase=Succeeded new.progress=0/1 nodeID=workflow-template-submittable-s62f5 old.message= old.phase=Pending old.progress=0/1 workflow=workflow-template-submittable-s62f5
time="2024-04-16T13:01:32.801Z" level=info msg="TaskSet Reconciliation" namespace=argo workflow=workflow-template-submittable-s62f5
time="2024-04-16T13:01:32.801Z" level=info msg=reconcileAgentPod namespace=argo workflow=workflow-template-submittable-s62f5
time="2024-04-16T13:01:32.801Z" level=info msg="Updated phase Running -> Succeeded" namespace=argo workflow=workflow-template-submittable-s62f5
time="2024-04-16T13:01:32.801Z" level=info msg="Marking workflow completed" namespace=argo workflow=workflow-template-submittable-s62f5
time="2024-04-16T13:01:32.811Z" level=info msg="Deleted PDB resource for workflow." namespace=argo workflow=workflow-template-submittable-s62f5
time="2024-04-16T13:01:32.812Z" level=info msg="Marking workflow as pending archiving" namespace=argo workflow=workflow-template-submittable-s62f5
time="2024-04-16T13:01:32.817Z" level=info msg="cleaning up pod" action=deletePod key=argo/workflow-template-submittable-s62f5-1340600742-agent/deletePod
time="2024-04-16T13:01:32.823Z" level=info msg="Workflow update successful" namespace=argo phase=Succeeded resourceVersion=910843781 workflow=workflow-template-submittable-s62f5
time="2024-04-16T13:01:32.847Z" level=info msg="archiving workflow" namespace=argo uid=52c3d78a-71cd-4c23-bab0-577df466df96 workflow=workflow-template-submittable-s62f5
time="2024-04-16T13:01:32.873Z" level=info msg="Queueing Succeeded workflow argo/workflow-template-submittable-s62f5 for delete in 15m0s due to TTL"
time="2024-04-16T13:01:37.848Z" level=info msg="cleaning up pod" action=deletePod key=argo/workflow-template-submittable-s62f5/deletePod

Logs from in your workflow's wait container

time="2024-04-16T13:07:54.035Z" level=info msg="Starting Workflow Executor" version=v3.5.5
time="2024-04-16T13:07:54.042Z" level=info msg="Using executor retry strategy" Duration=1s Factor=1.6 Jitter=0.5 Steps=5
time="2024-04-16T13:07:54.042Z" level=info msg="Executor initialized" deadline="2024-04-16 18:07:51 +0000 UTC" includeScriptOutput=false namespace=argo podName=workflow-template-submittable-75v6d templateName=whalesay-template version="&Version{Version:v3.5.5,BuildDate:2024-02-29T20:59:20Z,GitCommit:c80b2e91ebd7e7f604e88442f45ec630380effa0,GitTag:v3.5.5,GitTreeState:clean,GoVersion:go1.21.7,Compiler:gc,Platform:linux/amd64,}"
W0416 13:07:54.056902       1 warnings.go:70] Use tokens from the TokenRequest API or manually created secret-based tokens instead of auto-generated secret-based tokens.
time="2024-04-16T13:07:54.058Z" level=info msg="Starting deadline monitor"
time="2024-04-16T13:07:57.061Z" level=info msg="Main container completed" error="<nil>"
time="2024-04-16T13:07:57.061Z" level=info msg="No Script output reference in workflow. Capturing script output ignored"
time="2024-04-16T13:07:57.061Z" level=info msg="No output parameters"
time="2024-04-16T13:07:57.061Z" level=info msg="No output artifacts"
time="2024-04-16T13:07:57.061Z" level=info msg="GCS Save path: /tmp/argo/outputs/logs/main.log, key: workflow-template-submittable-75v6d/workflow-template-submittable-75v6d/main.log"
time="2024-04-16T13:07:57.329Z" level=info msg="Save artifact" artifactName=main-logs duration=267.438229ms error="<nil>" key=workflow-template-submittable-75v6d/workflow-template-submittable-75v6d/main.log
time="2024-04-16T13:07:57.329Z" level=info msg="not deleting local artifact" localArtPath=/tmp/argo/outputs/logs/main.log
time="2024-04-16T13:07:57.329Z" level=info msg="Successfully saved file: /tmp/argo/outputs/logs/main.log"
W0416 13:07:57.342993       1 warnings.go:70] Use tokens from the TokenRequest API or manually created secret-based tokens instead of auto-generated secret-based tokens.
W0416 13:07:57.352386       1 warnings.go:70] Use tokens from the TokenRequest API or manually created secret-based tokens instead of auto-generated secret-based tokens.
time="2024-04-16T13:07:57.352Z" level=info msg="Alloc=26117 TotalAlloc=32534 Sys=39781 NumGC=5 Goroutines=11"
W0416 13:07:57.362925       1 warnings.go:70] Use tokens from the TokenRequest API or manually created secret-based tokens instead of auto-generated secret-based tokens.
time="2024-04-16T13:07:57.363Z" level=info msg="stopping progress monitor (context done)" error="context canceled"
@agilgur5 agilgur5 added area/cli The `argo` CLI area/workflow-templates P1 High priority. All bugs with >=5 thumbs up that aren’t P0, plus: Any other bugs deemed high priority labels Apr 16, 2024
@agilgur5
Copy link
Member

The CLI is pretty straightforward to contribute to, here's the file responsible for argo submit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/cli The `argo` CLI area/workflow-templates P1 High priority. All bugs with >=5 thumbs up that aren’t P0, plus: Any other bugs deemed high priority type/bug
Projects
None yet
Development

No branches or pull requests

2 participants