Merge pull request #60602 from bendrucker/docker-registry-email-optional

Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

remove docker-email from required args for "create secret docker-registry"

Completes https://github.com/kubernetes/kubernetes/pull/42191

While that removed `docker-email` as required from the generator, the CLI still asserts the presence of the argument resulting in "error: flag docker-email is required" when `--docker-email` is omitted from a `kubectl create secret docker-registry` call.

Comments on the original issue (https://github.com/kubernetes/kubernetes/issues/41727) note that this change is still needed to accomplish the original intent.
This commit is contained in:
Kubernetes Submit Queue 2018-03-21 07:34:21 -07:00 committed by GitHub
commit 808545a8aa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -182,7 +182,7 @@ func CreateSecretDockerRegistry(f cmdutil.Factory, cmdOut io.Writer, cmd *cobra.
if err != nil {
return err
}
requiredFlags := []string{"docker-username", "docker-password", "docker-email", "docker-server"}
requiredFlags := []string{"docker-username", "docker-password", "docker-server"}
for _, requiredFlag := range requiredFlags {
if value := cmdutil.GetFlagString(cmd, requiredFlag); len(value) == 0 {
return cmdutil.UsageErrorf(cmd, "flag %s is required", requiredFlag)