Change:
If you run a command like: $ kubectl run --image=nginx --labels app=web --labels env=prod web It only uses the latest declaration of and drops the earlier options specified. Especially because the --help documentation on does not specify the format, this is impairing the user experience. I looked around a few other CLIs to see how they handle this. curl, for example, uses to additively collect headers (instead of a comma-separated list), therefore each value specified is used. "docker run" command ignores the earlier --name argument when you specify another one. I am wondering if we can easily detect non-additive/overwriting args specified multiple times in an invocation. /kind bug /sig cli
I think this is reasonable for improving cli tool user experience. For different commands, it may different in the options, but for each of them we can add warning messages at least for the end user to realize what had happened in the backend, especially for the ignored staff
/sig cli
why use for flag instead of ? i don't think should overwrite
/cc
Issues go stale after 90d of inactivity. Mark the issue as fresh with . Stale issues rot after an additional 30d of inactivity and eventually close. Prevent issues from auto-closing with an comment. If this issue is safe to close now please do so with . Send feedback to sig-testing, kubernetes/test-infra and/or . /lifecycle stale
Stale issues rot after 30d of inactivity. Mark the issue as fresh with . Rotten issues close after an additional 30d of inactivity. If this issue is safe to close now please do so with . Send feedback to sig-testing, kubernetes/test-infra and/or . /lifecycle rotten /remove-lifecycle stale
Rotten issues close after 30d of inactivity. Reopen the issue with . Mark the issue as fresh with . Send feedback to sig-testing, kubernetes/test-infra and/or . /close

Discussion:
# Start a single instance of hazelcast and set environment variables "DNS_DOMAIN=cluster" and "POD_NAMESPACE=default" in the container. kubectl run hazelcast --image=hazelcast --env="DNS_DOMAIN=cluster" --env="POD_NAMESPACE=default" <ins> # Start a single instance of hazelcast and set labels "app=hazelcast" and "env=prod" in the container. kubectl run hazelcast --image=nginx --labels="app=hazelcast,env=prod" </ins> # Start a replicated instance of nginx. kubectl run nginx --image=nginx --replicas=5

cmd.Flags().String("serviceaccount", "", "Service account to set in the pod spec") 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.") <del> cmd.Flags().StringP("labels", "l", "", "Labels to apply to the pod(s).") </del> <ins> cmd.Flags().StringP("labels", "l", "", "Comma separated labels to apply to the pod(s). Will override previous values.") </ins> cmd.Flags().BoolP("stdin", "i", false, "Keep stdin open on the container(s) in the pod, even if nothing is attached.") cmd.Flags().BoolP("tty", "t", false, "Allocated a TTY for each container in the pod.") cmd.Flags().Bool("attach", false, "If true, wait for the Pod to start running, and then attach to the Pod as if 'kubectl attach ...' were called.  Default false, unless '-i/--stdin' is set, in which case the default is true. With '--restart=Never' the exit code of the container process is returned.")