Ask for help! I want to get the state of each step using hooks onExit. #8321
Unanswered
LingClassmate
asked this question in
Q&A
Replies: 1 comment
-
The original workflow produced the following error: MESSAGE
Pod "container-on-exit-phftp-exitContainer-1772040650" is invalid: metadata.name: Invalid value:
"container-on-exit-phftp-exitContainer-1772040650": a lowercase RFC 1123 subdomain must consist of
lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character
(e.g. 'example.com', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*') After updating all template names and parameters to lowercase, the workflow executed successfully: Updated apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
generateName: container-on-exit-
namespace: argo
templates:
- name: step-template
steps:
- - name: stepA
template: echo1
hooks:
exit:
template: exit-container # Updated to lowercase
arguments:
parameters:
- name: container-status # Updated to lowercase
value: "{{steps.stepA.status}}"
- - name: stepB
template: echo2
hooks:
exit:
template: exit-container # Updated to lowercase
arguments:
parameters:
- name: container-status # Updated to lowercase
value: "{{steps.stepB.status}}"
- name: echo1
container:
name: ""
image: alpine:3.15
command:
- sh
- "-c"
args:
- echo "stepA"
- name: echo2
container:
name: ""
image: alpine:3.15
command:
- sh
- "-c"
args:
- echo "stepB" ;exit 1
- name: exit-container # Updated to lowercase
inputs:
parameters:
- name: container-status # Updated to lowercase
container:
name: ""
image: alpine:3.15
command:
- sh
- "-c"
args:
- "echo Container Status: {{inputs.parameters.container-status}}" # Updated to lowercase
entrypoint: step-template Resources: |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Ask for help! I want to get the status of each step using the hooks configuration as follows:
OnExit output:
But I can't get the step state, I can only get the strings, is there any other way to solve my problem?
Beta Was this translation helpful? Give feedback.
All reactions