pipeline icon indicating copy to clipboard operation
pipeline copied to clipboard

[0.35: cherry-pick] cmd/entrypoint: do not interpret anything after `--`

Open vdemeester opened this issue 3 years ago • 14 comments

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

vdemeester avatar Jul 07 '22 08:07 vdemeester

/cc @abayer @imjasonh @afrittoli

vdemeester avatar Jul 07 '22 08:07 vdemeester

/retest cloud event unit test flaky...

vdemeester avatar Jul 07 '22 08:07 vdemeester

/retest

vdemeester avatar Jul 07 '22 08:07 vdemeester

/retest

abayer avatar Jul 08 '22 11:07 abayer

/retest

vdemeester avatar Jul 15 '22 11:07 vdemeester

/retest /approve

abayer avatar Jul 15 '22 13:07 abayer

/lgtm

abayer avatar Jul 15 '22 13:07 abayer

/retest

abayer avatar Jul 15 '22 15:07 abayer

/retest

abayer avatar Jul 15 '22 20:07 abayer

/retest

abayer avatar Jul 18 '22 22:07 abayer

@tektoncd/core-maintainers We still need an approval here. =)

abayer avatar Jul 21 '22 11:07 abayer

/approve

afrittoli avatar Sep 09 '22 09:09 afrittoli

[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

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment Approvers can cancel approval by writing /approve cancel in a comment

tekton-robot avatar Sep 09 '22 09:09 tekton-robot

/retest

vdemeester avatar Oct 05 '22 09:10 vdemeester

@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.

tekton-robot avatar Oct 05 '22 09:10 tekton-robot

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.

tekton-robot avatar Jan 03 '23 10:01 tekton-robot