-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Weird argument arrangement when using script template #4481
Comments
Why not do this: name: "workflow-status-test"
script:
image: "python:3.6-alpine"
command:
- python3
source: |
import sys; import my_notify_func; my_notify_func("{{workflow.status}}") |
@alexec Yes, as I said, that works just fine and is more than enough for my use case. All I'm saying is that this behavior is unexpected/unintuitive. As soon as someone tries to use |
Got it. Would you like to submit a PR to fix? |
@alexec Sure |
…olves argoproj#4481 (argoproj#4492) Signed-off-by: ivancili <ivandotilic@gmail.com> Signed-off-by: Alex Capras <alexcapras@gmail.com>
Summary
I wanted to add a template that is activated on a workflow exit (the
onExit
field) with a purpose of notifying the user about the workflow status. I decided to use a template of typescript
, like this:This failed. After inspecting the pod, I saw that Argo passed the arguments to the python container in the following way
Succeeded /argo/staging/script
, I would expect it to do it like this/argo/staging/script Succeeded
.Later I noticed in one of your examples in git repo that I could embed a template directly in the
source
field. But this wasn't documented anywhere (at least I didnt see it). So, this solves my issue:The order in which the arguments are passed is unintuitive and I don't see a case where this particular order would be useful. My suggestion is to change the order (so first goes the script path, and then the user args) or put a notice/disclaimer in the docs. Also, you could provide an example for using templates here, or document it.
Use Cases
When would you use this?
Message from the maintainers:
Impacted by this bug? Give it a 👍. We prioritise the issues with the most 👍.
The text was updated successfully, but these errors were encountered: