Merge pull request #58030 from ahmetb/fix-fmt

Automatic merge from submit-queue (batch tested with PRs 57581, 58030). 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>.

cmd/kubectl: fix broken error formatting for run

This patch adds missing value to a format string (%s) in --restart flag
validation for "kubectl run".

"kubectl run --restart=foo" was giving error:

    error: invalid restart policy: %!s(MISSING)

Now it says:

    error: invalid restart policy: foo

/release-note-none
This commit is contained in:
Kubernetes Submit Queue 2018-01-09 23:11:29 -08:00 committed by GitHub
commit 4989087fbf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -501,7 +501,7 @@ func getRestartPolicy(cmd *cobra.Command, interactive bool) (api.RestartPolicy,
case api.RestartPolicyNever:
return api.RestartPolicyNever, nil
}
return "", cmdutil.UsageErrorf(cmd, "invalid restart policy: %s")
return "", cmdutil.UsageErrorf(cmd, "invalid restart policy: %s", restart)
}
func verifyImagePullPolicy(cmd *cobra.Command) error {