-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cmd/entrypoint: do not interpret anything after
--
The way the `flag` package works, it can eat the flag "terminator" (aka the double dash `--`). This means that, in some very specific cases — where the first item after the `--` is also a subcommand, it would execute the entrypoint subcommand instead of the actual command. For example : ``` $ /ko-app/entrypoint -- init a b $ /ko-app/entrypoint init a b ``` This is fixed by making sure we remove anything after `--` for the subcommand processing. And then we pass the rest (after `--`) to the entrypointer to be executed. Signed-off-by: Vincent Demeester <vdemeest@redhat.com>
- Loading branch information
1 parent
6876520
commit faa9f89
Showing
2 changed files
with
49 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
examples/v1beta1/taskruns/5080-entrypoint-init-regression.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
apiVersion: tekton.dev/v1beta1 | ||
kind: TaskRun | ||
metadata: | ||
generateName: tkn-arg-test- | ||
spec: | ||
params: | ||
- name: ARGS | ||
value: | ||
- init | ||
- foo | ||
- bar | ||
taskSpec: | ||
description: >- | ||
Test consuming args, acts as a regression test for bug 5080 | ||
params: | ||
- name: ARGS | ||
description: The terraform cli commands to tun | ||
type: array | ||
default: | ||
- "--help" | ||
steps: | ||
- name: echo-cli | ||
image: registry.access.redhat.com/ubi9/ubi-minimal:9.0.0-1580 | ||
workingDir: /tekton/home | ||
args: | ||
- "$(params.ARGS)" | ||
command: ["echo"] |