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 Signed-off-by: 's avatarAhmet Alp Balkan <ahmetb@google.com>
parent 78c8249c
...@@ -501,7 +501,7 @@ func getRestartPolicy(cmd *cobra.Command, interactive bool) (api.RestartPolicy, ...@@ -501,7 +501,7 @@ func getRestartPolicy(cmd *cobra.Command, interactive bool) (api.RestartPolicy,
case api.RestartPolicyNever: case api.RestartPolicyNever:
return api.RestartPolicyNever, nil 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 { func verifyImagePullPolicy(cmd *cobra.Command) error {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment