[0.35: cherry-pick] cmd/entrypoint: do not interpret anything after `--`
Changes
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 [email protected] (cherry picked from commit da91bf310f42c28596e51afe1fe927a3d9e32524) Signed-off-by: Vincent Demeester [email protected]
/kind bug
Submitter Checklist
As the author of this PR, please check off the items in this checklist:
- [ ] Docs included if any changes are user facing
- [x] Tests included if any functionality added or changed
- [x] Follows the commit message standard
- [x] Meets the Tekton contributor standards (including functionality, content, code)
- [x] Release notes block below has been filled in (if there are no user facing changes, use release note "NONE")
Release Notes
Fix the entrypoint potentially not executing the right command due to flag parsing
/cc @abayer @imjasonh @afrittoli
/retest cloud event unit test flaky...
/retest
/retest
/retest
/retest /approve
/lgtm
/retest
/retest
/retest
@tektoncd/core-maintainers We still need an approval here. =)
/approve
[APPROVALNOTIFIER] This PR is APPROVED
This pull-request has been approved by: abayer, afrittoli, lbernick
The full list of commands accepted by this bot can be found here.
The pull request process is described here
- ~~OWNERS~~ [afrittoli]
Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment
/retest
@vdemeester: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:
| Test name | Commit | Details | Required | Rerun command |
|---|---|---|---|---|
| pull-tekton-pipeline-build-tests | 27f519e3f3384ec4532dc90ef181a394d6e981ec | link | true | /test pull-tekton-pipeline-build-tests |
Full PR test history. Your PR dashboard.
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. I understand the commands that are listed here.
Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale with a justification.
Stale issues rot after an additional 30d of inactivity and eventually close.
If this issue is safe to close now please do so with /close with a justification.
If this issue should be exempted, mark the issue as frozen with /lifecycle frozen with a justification.
/lifecycle stale
Send feedback to tektoncd/plumbing.