Commit 56afb956 authored by Kubernetes Submit Queue's avatar Kubernetes Submit Queue Committed by GitHub

Merge pull request #41465 from bruceauyeung/k8s-branch-fix-kubectl-create-configmap-help-messages

Automatic merge from submit-queue fix kubectl create configmap help messages Signed-off-by: 's avatarbruceauyeung <ouyang.qinhua@zte.com.cn> **What this PR does / why we need it**: 1. the first example command actually doesn't specify any keys. i think `with keys for each file` is incorrect. 2. `names on disk` is confusing. in usage the word `NAME` means configmap, so i think it's better saying `file basenames on disk` 3. in this context, `--from-file` can be specified multiple times, but in each occurance only one key file can be specified, besides we should keep consistent with the later case (key is specified). so i changed words in this sentence to singular. and to avoid confusing, i use `key` instead of `name`
parents 6d5b2ef4 a410a63d
...@@ -42,10 +42,10 @@ var ( ...@@ -42,10 +42,10 @@ var (
symlinks, devices, pipes, etc).`) symlinks, devices, pipes, etc).`)
configMapExample = templates.Examples(` configMapExample = templates.Examples(`
# Create a new configmap named my-config with keys for each file in folder bar # Create a new configmap named my-config based on folder bar
kubectl create configmap my-config --from-file=path/to/bar kubectl create configmap my-config --from-file=path/to/bar
# Create a new configmap named my-config with specified keys instead of names on disk # Create a new configmap named my-config with specified keys instead of file basenames on disk
kubectl create configmap my-config --from-file=key1=/path/to/bar/file1.txt --from-file=key2=/path/to/bar/file2.txt kubectl create configmap my-config --from-file=key1=/path/to/bar/file1.txt --from-file=key2=/path/to/bar/file2.txt
# Create a new configmap named my-config with key1=config1 and key2=config2 # Create a new configmap named my-config with key1=config1 and key2=config2
...@@ -69,7 +69,7 @@ func NewCmdCreateConfigMap(f cmdutil.Factory, cmdOut io.Writer) *cobra.Command { ...@@ -69,7 +69,7 @@ func NewCmdCreateConfigMap(f cmdutil.Factory, cmdOut io.Writer) *cobra.Command {
cmdutil.AddValidateFlags(cmd) cmdutil.AddValidateFlags(cmd)
cmdutil.AddPrinterFlags(cmd) cmdutil.AddPrinterFlags(cmd)
cmdutil.AddGeneratorFlags(cmd, cmdutil.ConfigMapV1GeneratorName) cmdutil.AddGeneratorFlags(cmd, cmdutil.ConfigMapV1GeneratorName)
cmd.Flags().StringSlice("from-file", []string{}, "Key files can be specified using their file path, in which case a default name will be given to them, or optionally with a name and file path, in which case the given name will be used. Specifying a directory will iterate each named file in the directory that is a valid configmap key.") cmd.Flags().StringSlice("from-file", []string{}, "Key file can be specified using its file path, in which case file basename will be used as configmap key, or optionally with a key and file path, in which case the given key will be used. Specifying a directory will iterate each named file in the directory whose basename is a valid configmap key.")
cmd.Flags().StringArray("from-literal", []string{}, "Specify a key and literal value to insert in configmap (i.e. mykey=somevalue)") cmd.Flags().StringArray("from-literal", []string{}, "Specify a key and literal value to insert in configmap (i.e. mykey=somevalue)")
return cmd return cmd
} }
......
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