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

Use two conditions at the same is not working #872

Closed
wanghong230 opened this issue Jun 1, 2018 · 2 comments
Closed

Use two conditions at the same is not working #872

wanghong230 opened this issue Jun 1, 2018 · 2 comments

Comments

@wanghong230
Copy link
Member

Is this a BUG REPORT or FEATURE REQUEST?:
BUG
What happened:

See templates for detail.

The step 1 is skipped, step2 is also skipped, but it will hit the parameter resolvement error since step2 is refering step1 even though step 2 is also skipped.

What you expected to happen:

The workflow validation could be knowing the true dependencies, and don't error out if the step won't be executed.

Workaround:

Fold two steps into one big step, and skip them together with just one condition.

  templates:
  - name: namespace-create
    steps:
    - - name: cluster-update
        template: cluster-iks-update
        when: "{{workflow.parameters.instance-group}} == true"
    - - name: kops-state-archive
        template: kops-state-archive
        arguments:
          artifacts:
          - name: kops-state-tar
            from: "{{steps.cluster-update.outputs.artifacts.kops-state-tar}}"
          - name: iks-state-tar
            from: "{{steps.cluster-update.outputs.artifacts.iks-state-tar}}"
          - name: aws-state-tar
            from: "{{steps.cluster-update.outputs.artifacts.aws-state-tar}}"
        when: "{{workflow.parameters.instance-group}} == true"
    - - name: namespace-create
        template: iks-namespace-create
time="2018-05-30T23:04:38Z" level=info msg="Processing workflow" namespace=iksm workflow=namespace-create-rdsc4
time="2018-05-30T23:04:38Z" level=info msg="Updated phase  -> Running" namespace=iksm workflow=namespace-create-rdsc4
time="2018-05-30T23:04:38Z" level=info msg="Steps node namespace-create-rdsc4 (namespace-create-rdsc4) initialized Running" namespace=iksm workflow=namespace-create-rdsc4
time="2018-05-30T23:04:38Z" level=info msg="StepGroup node namespace-create-rdsc4[0] (namespace-create-rdsc4-74472472) initialized Running" namespace=iksm workflow=namespace-create-rdsc4
time="2018-05-30T23:04:38Z" level=info msg="Skipping namespace-create-rdsc4[0].cluster-update: when 'false == true' evaluated false" namespace=iksm workflow=namespace-create-rdsc4
time="2018-05-30T23:04:38Z" level=info msg="Skipped node namespace-create-rdsc4[0].cluster-update (namespace-create-rdsc4-554190698) initialized Skipped (message: when 'false == true' evaluated false)" namespace=iksm workflow=namespace-create-rdsc4
time="2018-05-30T23:04:38Z" level=info msg="Step group node namespace-create-rdsc4[0] (namespace-create-rdsc4-74472472) successful" namespace=iksm workflow=namespace-create-rdsc4
time="2018-05-30T23:04:38Z" level=info msg="node namespace-create-rdsc4[0] (namespace-create-rdsc4-74472472) phase Running -> Succeeded" namespace=iksm workflow=namespace-create-rdsc4
time="2018-05-30T23:04:38Z" level=info msg="node namespace-create-rdsc4[0] (namespace-create-rdsc4-74472472) finished: 2018-05-30 23:04:38.872716969 +0000 UTC" namespace=iksm workflow=namespace-create-rdsc4
time="2018-05-30T23:04:38Z" level=info msg="StepGroup node namespace-create-rdsc4[1] (namespace-create-rdsc4-141435853) initialized Running" namespace=iksm workflow=namespace-create-rdsc4
time="2018-05-30T23:04:38Z" level=info msg="SG Outbound nodes of namespace-create-rdsc4-554190698 are []" namespace=iksm workflow=namespace-create-rdsc4
time="2018-05-30T23:04:38Z" level=info msg="node namespace-create-rdsc4[1] (namespace-create-rdsc4-141435853) phase Running -> Error" namespace=iksm workflow=namespace-create-rdsc4
time="2018-05-30T23:04:38Z" level=info msg="node namespace-create-rdsc4[1] (namespace-create-rdsc4-141435853) message: Unable to resolve: {{steps.cluster-update.outputs.artifacts.kops-state-tar}}" namespace=iksm workflow=namespace-create-rdsc4
time="2018-05-30T23:04:38Z" level=info msg="node namespace-create-rdsc4[1] (namespace-create-rdsc4-141435853) finished: 2018-05-30 23:04:38.88143195 +0000 UTC" namespace=iksm workflow=namespace-create-rdsc4
time="2018-05-30T23:04:38Z" level=info msg="step group namespace-create-rdsc4[1] (namespace-create-rdsc4-141435853) was unsuccessful: Unable to resolve: {{steps.cluster-update.outputs.artifacts.kops-state-tar}}" namespace=iksm workflow=namespace-create-rdsc4
time="2018-05-30T23:04:38Z" level=info msg="Updated phase Running -> Error" namespace=iksm workflow=namespace-create-rdsc4
time="2018-05-30T23:04:38Z" level=info msg="Updated message  -> runtime error: invalid memory address or nil pointer dereference" namespace=iksm workflow=namespace-create-rdsc4
time="2018-05-30T23:04:38Z" level=info msg="Marking workflow completed" namespace=iksm workflow=namespace-create-rdsc4
time="2018-05-30T23:04:38Z" level=error msg="Recovered from panic: runtime error: invalid memory address or nil pointer dereference\ngoroutine 63 [running]:\nruntime/debug.Stack(0xc4206c8300, 0x1889680, 0x18e7360)\n\t/usr/local/go/src/runtime/debug/stack.go:24 +0xa7\ngithub.com/argoproj/argo/workflow/controller.(*wfOperationCtx).operate.func1(0xc4206c8300)\n\t/root/go/src/github.com/argoproj/argo/workflow/controller/operator.go:108 +0xb5\npanic(0x10422c0, 0x18e7360)\n\t/usr/local/go/src/runtime/panic.go:491 +0x283\ngithub.com/argoproj/argo/workflow/controller.(*wfOperationCtx).updateOutboundNodes(0xc4206c8300, 0xc42077e3c0, 0x16, 0xc420404500)\n\t/root/go/src/github.com/argoproj/argo/workflow/controller/steps.go:114 +0x1af\ngithub.com/argoproj/argo/workflow/controller.(*wfOperationCtx).executeSteps(0xc4206c8300, 0xc42077e3c0, 0x16, 0xc420404500, 0x0, 0x0, 0x0)\n\t/root/go/src/github.com/argoproj/argo/workflow/controller/steps.go:77 +0x9e7\ngithub.com/argoproj/argo/workflow/controller.(*wfOperationCtx).executeTemplate(0xc4206c8300, 0xc42001cfb0, 0x10, 0xc42036fb00, 0xa, 0xa, 0x0, 0x0, 0x0, 0xc42077e3c0, ...)\n\t/root/go/src/github.com/argoproj/argo/workflow/controller/operator.go:864 +0x964\ngithub.com/argoproj/argo/workflow/controller.(*wfOperationCtx).operate(0xc4206c8300)\n\t/root/go/src/github.com/argoproj/argo/workflow/controller/operator.go:146 +0x37c\ngithub.com/argoproj/argo/workflow/controller.(*WorkflowController).processNextItem(0xc4202a0000, 0x82e400)\n\t/root/go/src/github.com/argoproj/argo/workflow/controller/controller.go:216 +0x27c\ngithub.com/argoproj/argo/workflow/controller.(*WorkflowController).runWorker(0xc4202a0000)\n\t/root/go/src/github.com/argoproj/argo/workflow/controller/controller.go:182 +0x2b\ngithub.com/argoproj/argo/workflow/controller.(*WorkflowController).(github.com/argoproj/argo/workflow/controller.runWorker)-fm()\n\t/root/go/src/github.com/argoproj/argo/workflow/controller/controller.go:149 +0x2a\ngithub.com/argoproj/argo/vendor/k8s.io/apimachinery/pkg/util/wait.JitterUntil.func1(0xc4201201d0)\n\t/root/go/src/github.com/argoproj/argo/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:133 +0x5e\ngithub.com/argoproj/argo/vendor/k8s.io/apimachinery/pkg/util/wait.JitterUntil(0xc4201201d0, 0x3b9aca00, 0x0, 0x6622534000000001, 0xc4200661e0)\n\t/root/go/src/github.com/argoproj/argo/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:134 +0xbd\ngithub.com/argoproj/argo/vendor/k8s.io/apimachinery/pkg/util/wait.Until(0xc4201201d0, 0x3b9aca00, 0xc4200661e0)\n\t/root/go/src/github.com/argoproj/argo/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:88 +0x4d\ncreated by github.com/argoproj/argo/workflow/controller.(*WorkflowController).Run\n\t/root/go/src/github.com/argoproj/argo/workflow/controller/controller.go:149 +0x597\n" namespace=iksm workflow=namespace-create-rdsc4
time="2018-05-30T23:04:38Z" level=info msg="Workflow update successful" namespace=iksm workflow=namespace-create-rdsc4
@wanghong230 wanghong230 changed the title User two conditions at the same is not working Use two conditions at the same is not working Jun 1, 2018
@jiuchongxiao
Copy link

i have the same issue

@stale
Copy link

stale bot commented Jul 2, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Jul 2, 2020
@stale stale bot closed this as completed Jul 9, 2020
icecoffee531 pushed a commit to icecoffee531/argo-workflows that referenced this issue Jan 5, 2022
* chore: Remove unused filter name. Closes argoproj#872

* fix test case
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

No branches or pull requests

2 participants