-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
fix mandatory parameter in login/logout #5233
Conversation
cmd/podman/logout.go
Outdated
return errors.Errorf("registry must be given") | ||
registriesFromFile, err := registries.GetRegistries() | ||
if err != nil || len(registriesFromFile) == 0 { | ||
return errors.Errorf("registry must be given") |
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.
suggest:
"no registries found in registries.conf, a registry must be provided"
0b26f48
to
8923e82
Compare
LGTM |
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
@QiWang19 looks like you've some test unhappiness that needs to be tended to. |
@QiWang19 Please fix the tests so we can get this merged. |
8923e82
to
f81319a
Compare
@rhatdan @TomSweeneyRedHat we can get this in |
test/e2e/login_logout_test.go
Outdated
session := podmanTest.Podman([]string{"login", "-u", "podmantest", "-p", "test"}) | ||
session.WaitWithDefaultTimeout() | ||
Expect(session.LineInOutputContains("docker.io")) | ||
Expect(session.ExitCode()).To(Not(Equal(0))) |
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 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?
f81319a
to
4ea7e6f
Compare
/approve |
[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 |
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]>
4ea7e6f
to
4c13501
Compare
/lgtm |
LGTM |
/hold cancel |
/test images |
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]>
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]>
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]>
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]