kubernetes / kubectl

Issue tracker and mirror of kubectl code
Apache License 2.0
2.82k stars 909 forks source link

kubectl create secret generic --help does not describe type #1452

Open rbaumgar opened 1 year ago

rbaumgar commented 1 year ago

What would you like to be added: the command "kubectl create secret generic --help"

does not describe the type option.

$ kubectl create secret generic --help
Create a secret based on a file, directory, or specified literal value.

 A single secret may package one or more key/value pairs.

...

Examples:
  # Create a new secret named my-secret with keys for each file in folder bar
  kubectl create secret generic my-secret --from-file=path/to/bar

  # Create a new secret named my-secret with specified keys instead of names on disk
  kubectl create secret generic my-secret --from-file=ssh-privatekey=path/to/id_rsa --from-file=ssh-publickey=path/to/id_rsa.pub

  # Create a new secret named my-secret with key1=supersecret and key2=topsecret
  kubectl create secret generic my-secret --from-literal=key1=supersecret --from-literal=key2=topsecret

  # Create a new secret named my-secret using a combination of a file and a literal
  kubectl create secret generic my-secret --from-file=ssh-privatekey=path/to/id_rsa --from-literal=passphrase=topsecret

  # Create a new secret named my-secret from env files
  kubectl create secret generic my-secret --from-env-file=path/to/foo.env --from-env-file=path/to/bar.env

Options:
...
    --type='':
    The type of secret to create
...

Why is this needed:

No example. No description of what type is allowed.

working example:

$ kubectl create secret generic quay-registry \
--from-file .dockerconfigjson=${XDG_RUNTIME_DIR}/containers/auth.json \
--type kubernetes.io/dockerconfigjson
Ritikaa96 commented 1 year ago

/sig cli The description of --type can be better. I'd like to add this change once it is triaged by cli members

Ritikaa96 commented 1 year ago

Also as per Opaque-secrets we use the generic subcommand to indicate an Opaque Secret type. This should be mentioned but the explanation has only kubectl create secret description. Need more information in the description for Opaque-secrets

mpuckett159 commented 1 year ago

/triage accepted

Ritikaa96 commented 1 year ago

/assign

Ritikaa96 commented 1 year ago

JFYI Raised the PR here

k8s-triage-robot commented 3 weeks ago

This issue has not been updated in over 1 year, and should be re-triaged.

You can:

For more details on the triage process, see https://www.kubernetes.dev/docs/guide/issue-triage/

/remove-triage accepted

Ritikaa96 commented 2 weeks ago

/triage accepted

Ritikaa96 commented 1 week ago

posting here as reminder. Here is the PR waiting for approval : https://github.com/kubernetes/kubernetes/pull/120337