-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
cmd/entrypoint: do not interpret anything after --
#5084
cmd/entrypoint: do not interpret anything after --
#5084
Conversation
@vdemeester: The label(s) In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
This probably need at least one test 🙃 working on it. |
The following is the coverage report on the affected files.
|
4e7e445
to
e006882
Compare
The following is the coverage report on the affected files.
|
🤔 those are new "unit test" flakes ? 🤔 |
/test tekton-pipeline-unit-tests |
913dfc7
to
faa9f89
Compare
The following is the coverage report on the affected files.
|
faa9f89
to
bcfa0cf
Compare
The following is the coverage report on the affected files.
|
/retest |
I believe the unit test flakes are due to my change decreasing requests/limits for that job - tektoncd/plumbing#1124 reverts that change. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a bit worried that this could cause something else to fail, due to all the fun complicated behaviors around --
, but I can't think of anything better. =)
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: abayer The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
bcfa0cf
to
ab5633f
Compare
The following is the coverage report on the affected files.
|
"github.com/google/go-cmp/cmp" | ||
) | ||
|
||
func TestExtractArgs(t *testing.T) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❤️
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for adding the tests!
/lgtm
ab5633f
to
9aa5e5c
Compare
The following is the coverage report on the affected files.
|
/lgtm |
/restest |
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>
9aa5e5c
to
5a5703c
Compare
The following is the coverage report on the affected files.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
Changes
The way the
flag
package works, it can eat the flag"terminator" (aka the double dash
--
). This means that, in some veryspecific cases — where the first item after the
--
is also asubcommand, it would execute the entrypoint subcommand instead of the
actual command.
For example :
This is fixed by making sure we remove anything after
--
for thesubcommand processing. And then we pass the rest (after
--
) to theentrypointer to be executed.
Note for the reviewers: this is one approach (mutate
os.Args
) that is relatively contained. The other way to fix that would be to have anexec
subcommand that would be used to exec things, but this means changing all containers commands as well which.. might be a bit much for bug fixes at least.In any case, I think the entrypoint binary needs a bit of love and refactoring.
Signed-off-by: Vincent Demeester vdemeest@redhat.com
Fixes #5080
/kind bug
/priority critial-urgent
This will have to be cherry-pick in all release from 0.35 to 0.37 😅
Submitter Checklist
As the author of this PR, please check off the items in this checklist:
functionality, content, code)
(if there are no user facing changes, use release note "NONE")
Release Notes