andor.yaml 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. apiVersion: argoproj.io/v1alpha1
  2. kind: WorkflowTemplate
  3. metadata:
  4. name: andor
  5. spec:
  6. entrypoint: approve-flow
  7. arguments:
  8. parameters:
  9. - name: object
  10. value: {}
  11. templates:
  12. - name: approve-flow
  13. inputs:
  14. parameters:
  15. - name: object
  16. dag:
  17. tasks:
  18. - name: A
  19. template: approval
  20. - name: B
  21. template: approval
  22. depends: "A.Succeeded"
  23. when: "{{ tasks.A.outputs.parameters.approve }} == 通过"
  24. - name: C
  25. template: approval
  26. depends: "A.Succeeded"
  27. when: "{{ tasks.A.outputs.parameters.approve }} == 通过"
  28. - name: D
  29. template: approval
  30. depends: "B.Succeeded && C.Succeeded"
  31. when: "({{ tasks.B.outputs.parameters.approve }} == 通过) && ({{ tasks.C.outputs.parameters.approve }} == 通过)"
  32. - name: E
  33. template: approval
  34. depends: "B.Succeeded && C.Succeeded"
  35. when: "({{ tasks.B.outputs.parameters.approve }} == 通过) && ({{ tasks.C.outputs.parameters.approve }} == 通过)"
  36. - name: F
  37. template: approval
  38. depends: "D.Succeeded && E.Succeeded"
  39. when: "({{ tasks.D.outputs.parameters.approve }} == 通过) || ({{ tasks.E.outputs.parameters.approve }} == 通过)"
  40. - name: approval
  41. suspend: {}
  42. inputs:
  43. parameters:
  44. - name: approve
  45. default: '通过'
  46. enum:
  47. - '通过'
  48. - '拒绝'
  49. - '忽略'
  50. outputs:
  51. parameters:
  52. - name: approve
  53. valueFrom:
  54. supplied: {}