-
Notifications
You must be signed in to change notification settings - Fork 453
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
Add --auth
support for crictl pull
.
#390
Conversation
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Random-Liu 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 |
} | ||
auth, err := getAuth(context.String("creds"), context.String("auth")) | ||
if err != nil { | ||
return err | ||
} | ||
var sandbox *pb.PodSandboxConfig | ||
if context.IsSet("pod-config") { |
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.
declaration of "err" shadows declaration at cmd/crictl/image.go:81 (vetshadow)
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.
That is super annoying, we ignore that error in containerd. :P
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.
Done
093f509
to
150018e
Compare
@@ -56,6 +56,11 @@ var pullImageCommand = cli.Command{ | |||
Value: "", | |||
Usage: "Use `USERNAME[:PASSWORD]` for accessing the registry", | |||
}, | |||
cli.StringFlag{ |
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.
Should the command fail when both "creds" and "auth" are specified? If not, the usage should explain which takes precedence over the other.
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.
Done. Let it fail.
cmd/crictl/image.go
Outdated
@@ -74,12 +79,9 @@ var pullImageCommand = cli.Command{ | |||
} | |||
|
|||
var auth *pb.AuthConfig |
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.
No need to declare auth
upfront.
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.
Done.
Signed-off-by: Lantao Liu <lantaol@google.com>
150018e
to
293aed6
Compare
/lgtm You tested this manually, right? ;-) |
This is supported by docker, and also very useful if the username:password is very complex.
Example:
Signed-off-by: Lantao Liu lantaol@google.com