From b99e57149d81aef8b0bbb3181f851257d18a2569 Mon Sep 17 00:00:00 2001 From: ymqytw Date: Tue, 13 Jun 2017 14:53:09 -0700 Subject: [PATCH] fix env flag --- pkg/kubectl/cmd/run.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/kubectl/cmd/run.go b/pkg/kubectl/cmd/run.go index 831fea073dd..910efa48f34 100644 --- a/pkg/kubectl/cmd/run.go +++ b/pkg/kubectl/cmd/run.go @@ -117,7 +117,7 @@ func addRunFlags(cmd *cobra.Command) { cmd.Flags().IntP("replicas", "r", 1, "Number of replicas to create for this container. Default is 1.") cmd.Flags().Bool("rm", false, "If true, delete resources created in this command for attached containers.") cmd.Flags().String("overrides", "", i18n.T("An inline JSON override for the generated object. If this is non-empty, it is used to override the generated object. Requires that the object supply a valid apiVersion field.")) - cmd.Flags().StringSlice("env", []string{}, "Environment variables to set in the container") + cmd.Flags().StringArray("env", []string{}, "Environment variables to set in the container") cmd.Flags().String("port", "", i18n.T("The port that this container exposes. If --expose is true, this is also the port used by the service that is created.")) cmd.Flags().Int("hostport", -1, "The host port mapping for the container port. To demonstrate a single-machine container.") cmd.Flags().StringP("labels", "l", "", "Labels to apply to the pod(s).") @@ -257,7 +257,7 @@ func Run(f cmdutil.Factory, cmdIn io.Reader, cmdOut, cmdErr io.Writer, cmd *cobr params["args"] = args[1:] } - params["env"] = cmdutil.GetFlagStringSlice(cmd, "env") + params["env"] = cmdutil.GetFlagStringArray(cmd, "env") obj, _, mapper, mapping, err := createGeneratedObject(f, cmd, generator, names, params, cmdutil.GetFlagString(cmd, "overrides"), namespace) if err != nil {