Skip to content
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

Refactor parsing to not require --remote to be first flag #7212

Merged
merged 1 commit into from
Aug 5, 2020

Conversation

jwhonce
Copy link
Member

@jwhonce jwhonce commented Aug 3, 2020

Use cobra.Command.FParseErrWhitelist to no longer require --remote to be
the first argument in flags when using CLI

  • tweaked test utils to prevent panics

Fixes: #7211

Signed-off-by: Jhon Honce jhonce@redhat.com

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 3, 2020
@jwhonce jwhonce requested a review from mheon August 3, 2020 22:46
@mheon
Copy link
Member

mheon commented Aug 3, 2020

LGTM

@rhatdan
Copy link
Member

rhatdan commented Aug 4, 2020

/lgtm
/hold

@openshift-ci-robot openshift-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Aug 4, 2020
@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Aug 4, 2020
Copy link
Member

@vrothberg vrothberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add a test to prevent regressing?

It's okay if we have non-zero exit status but check for the correct error message.

@openshift-ci-robot openshift-ci-robot removed the lgtm Indicates that a PR is ready to be merged. label Aug 4, 2020
@jwhonce jwhonce force-pushed the issues/7211 branch 2 times, most recently from e6bb27a to 34cd6d3 Compare August 5, 2020 17:19
@openshift-ci-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jwhonce

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

Use cobra.Command.FParseErrWhitelist to no longer require --remote to be
the first argument in flags when using CLI

Signed-off-by: Jhon Honce <jhonce@redhat.com>
@edsantiago
Copy link
Member

LGTM.

@vrothberg I agree with the need for a test, but this is hard to test because it requires muckery (detecting that the podman command is podman-remote, then strip off the -remote (but preserve any other arguments present), then run that in various combinations. That's much easier in bash than go, so I have a system test in the works for it. My test fails (as expected) on master, passes when run against this code. I will submit it as part of a system-test update, probably early Monday.

@edsantiago
Copy link
Member

/hold cancel

@openshift-ci-robot openshift-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Aug 5, 2020
@jwhonce
Copy link
Member Author

jwhonce commented Aug 5, 2020

@edsantiago Thanks!

/hold cancel

@edsantiago
Copy link
Member

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Aug 5, 2020
@openshift-merge-robot openshift-merge-robot merged commit a948635 into containers:master Aug 5, 2020
edsantiago added a commit to edsantiago/libpod that referenced this pull request Aug 10, 2020
- new sanity checks for podman-remote:
  - first, confirm that when PODMAN is "-remote",
    we actually talk to a server (validated by
    presence of "Server:" string in "podman version").
  - second, add test for containers#7212, in which we run
    "podman --remote" (podman with --remote flag,
    not podman-remote command) and make sure --remote
    is allowed both as the first option and also
    with other flag options preceding.

- new test for "podman image tree" (piggybacking on
  top of a "podman build" test, because that gives
  us lots of layers).

- skip "podman exec - basic test" when remote. It is consistently
  causing CI failures, breaking all of CI, due to containers#7241.

Signed-off-by: Ed Santiago <santiago@redhat.com>
Luap99 pushed a commit to Luap99/libpod that referenced this pull request Aug 30, 2020
- new sanity checks for podman-remote:
  - first, confirm that when PODMAN is "-remote",
    we actually talk to a server (validated by
    presence of "Server:" string in "podman version").
  - second, add test for containers#7212, in which we run
    "podman --remote" (podman with --remote flag,
    not podman-remote command) and make sure --remote
    is allowed both as the first option and also
    with other flag options preceding.

- new test for "podman image tree" (piggybacking on
  top of a "podman build" test, because that gives
  us lots of layers).

- skip "podman exec - basic test" when remote. It is consistently
  causing CI failures, breaking all of CI, due to containers#7241.

Signed-off-by: Ed Santiago <santiago@redhat.com>
@jwhonce jwhonce deleted the issues/7211 branch June 30, 2021 16:09
@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 23, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Podman --remote argument ordering can instead run local Podman
7 participants