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

fix mandatory parameter in login/logout #5233

Merged

Conversation

QiWang19
Copy link
Contributor

fix #5146
Insted of using a registry as mandatory parameter, this path allows podman to use the first registry from registries.conf.

Signed-off-by: Qi Wang [email protected]

return errors.Errorf("registry must be given")
registriesFromFile, err := registries.GetRegistries()
if err != nil || len(registriesFromFile) == 0 {
return errors.Errorf("registry must be given")
Copy link
Member

Choose a reason for hiding this comment

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

suggest:
"no registries found in registries.conf, a registry must be provided"

@rhatdan
Copy link
Member

rhatdan commented Feb 17, 2020

LGTM

Copy link
Member

@TomSweeneyRedHat TomSweeneyRedHat left a comment

Choose a reason for hiding this comment

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

LGTM

@TomSweeneyRedHat
Copy link
Member

@QiWang19 looks like you've some test unhappiness that needs to be tended to.

@rhatdan
Copy link
Member

rhatdan commented Feb 18, 2020

@QiWang19 Please fix the tests so we can get this merged.

@QiWang19
Copy link
Contributor Author

@rhatdan @TomSweeneyRedHat we can get this in

session := podmanTest.Podman([]string{"login", "-u", "podmantest", "-p", "test"})
session.WaitWithDefaultTimeout()
Expect(session.LineInOutputContains("docker.io"))
Expect(session.ExitCode()).To(Not(Equal(0)))
Copy link
Member

Choose a reason for hiding this comment

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

I think this is testing the case when there's no registry in registry.conf and it fails. Can we test the case when there is an entry in registries.conf that woud succeed?

@rhatdan
Copy link
Member

rhatdan commented Feb 18, 2020

/approve
/lgtm
/hold
hold cancel when tests pass.

@openshift-ci-robot openshift-ci-robot added do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. lgtm Indicates that a PR is ready to be merged. labels Feb 18, 2020
@openshift-ci-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: QiWang19, rhatdan

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

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 18, 2020
fix containers#5146
Insted of using a registry as mandatory parameter, this path allows podman to use the first registry from registries.conf.

Signed-off-by: Qi Wang <[email protected]>
@openshift-ci-robot openshift-ci-robot removed the lgtm Indicates that a PR is ready to be merged. label Feb 18, 2020
@rhatdan
Copy link
Member

rhatdan commented Feb 18, 2020

/lgtm
/hold

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Feb 18, 2020
@TomSweeneyRedHat
Copy link
Member

LGTM

@TomSweeneyRedHat
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 Feb 18, 2020
@QiWang19
Copy link
Contributor Author

/test images

@openshift-merge-robot openshift-merge-robot merged commit cba5791 into containers:master Feb 19, 2020
edsantiago added a commit to edsantiago/libpod that referenced this pull request Apr 29, 2020
If a usage message is of the form '... [flags] ARGNAME',
where ARGNAME is all-caps and not in brackets, it must
be a required argument. Try running podman subcommand
without ARGNAME, and make sure that podman bails out
with an informative message. (Since this message is
freeform in each subcommand, not Cobra-generated,
we have a lot of possible variations to check for).

Fix podman login/logout Use messages to indicate that
REGISTRY is now optional (as of containers#5233).

This test has actually been in place for over a year but
due to a typo on my part -- a missing space -- it was
not being run. "For want of a space, much testing was lost".

Signed-off-by: Ed Santiago <[email protected]>
baude pushed a commit to baude/podman that referenced this pull request Apr 30, 2020
If a usage message is of the form '... [flags] ARGNAME',
where ARGNAME is all-caps and not in brackets, it must
be a required argument. Try running podman subcommand
without ARGNAME, and make sure that podman bails out
with an informative message. (Since this message is
freeform in each subcommand, not Cobra-generated,
we have a lot of possible variations to check for).

Fix podman login/logout Use messages to indicate that
REGISTRY is now optional (as of containers#5233).

This test has actually been in place for over a year but
due to a typo on my part -- a missing space -- it was
not being run. "For want of a space, much testing was lost".

Signed-off-by: Ed Santiago <[email protected]>
snj33v pushed a commit to snj33v/libpod that referenced this pull request May 31, 2020
If a usage message is of the form '... [flags] ARGNAME',
where ARGNAME is all-caps and not in brackets, it must
be a required argument. Try running podman subcommand
without ARGNAME, and make sure that podman bails out
with an informative message. (Since this message is
freeform in each subcommand, not Cobra-generated,
we have a lot of possible variations to check for).

Fix podman login/logout Use messages to indicate that
REGISTRY is now optional (as of containers#5233).

This test has actually been in place for over a year but
due to a typo on my part -- a missing space -- it was
not being run. "For want of a space, much testing was lost".

Signed-off-by: Ed Santiago <[email protected]>
@QiWang19 QiWang19 deleted the login/out-parameter branch June 26, 2020 15:11
@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 24, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 24, 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 login with different mandatory parameter than docker login
5 participants