-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
fix(controller): Revert prepending ExecutorScriptSourcePath which brought a breaking change in args handling #4884
Conversation
Did you author these changes originally? |
@ivancili would you like to chip it? Would you like to propose a fix so everyone is happy? |
f56d05c
to
842b7f8
Compare
@alexec @MrFreezeex In my opinion, the correct behavior of a script template should include the ability to pass arbitrary args to the script (one way, or another). The example provided in this issue seems like an incorrect usage to me, though. I would just put the [sh] into command section of the template, or prepare the entrypoint of the base image fully. Nevertheless, I see your point, and I realize my PR introduced a breaking change and it should be fixed, I apologize for the inconvenience. Here are my proposals on how to fix this:
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
name: test-args-script
spec:
entrypoint: test
templates:
- name: test
script:
image: mrfreezeex/test-argow-script:v1
args: [sh]
argsPosition: prepend # other option is append
source: |
echo "This message will be shown!"
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
name: test-args-script
spec:
entrypoint: test
templates:
- name: test
script:
image: mrfreezeex/test-argow-script:v1
args: [sh]
sourceArgs:
- "Hello"
source: |
echo "This message will be shown!"
echo $1 there # prints "Hello there"
Let me know your thoughts. |
From my point of view, I think that the |
842b7f8
to
ae12c81
Compare
aa89df3
to
81e1da0
Compare
I updated my PR to add sourceArgs instead of reverting the commit. |
2e854c5
to
5b31a3c
Compare
Since #4492 introduced a regression/change in behavior, it should be reverted. If there is confusion about how script templates work, we should document the behavior better rather than implement additional knobs, especially since there are alternatives to achieve the desired use case. Can we simplify this PR to just a revert of #4492? |
3435c51
to
122748e
Compare
122748e
to
ec3515e
Compare
I just did that but for some reasons now a test is failing:
I don't think that's something related to this code change but I retried It once already... Do you know if this test can be a bit flaky sometimes ? |
…ught a breaking change in args handling This reverts commit 64ae330. Signed-off-by: Arthur Outhenin-Chalandre <arthur@cri.epita.fr>
ec3515e
to
f9e9a66
Compare
TestDeletingRunningPod is broken |
@ivancili we've reverted your commit because it was a breaking change that resulted in a regression. Would you like to consider suggesting a new way to do this that is non-breaking? |
Hi guys @alexec @ivancili @MrFreezeex , looks like this revert broken our script |
This reverts commit 64ae330.
This PR reverts #4492 which changes the way args are passed to a script template. Due to this change we are not able to override
args
with a docker image and an entrypoint with anexec "$@"
in argo workflow 2.12.x.This is convenient to execute the docker entrypoint of the base image and then execute the script in the workflow. We use it to do some privileged action and then drop those privileges before executing the script passed in the workflow. You can find more information in #4782 with an example to test the behavior that brokes in 2.12.x.
This revert will obviously break the behavior that the author of this commit has intended to introduce so I don't know if reverting is the best things to do...
Resolves #4782