kubectl
kubectl copied to clipboard
Kubectl explain show "example" section for CRD fields
Hello all.
How can users view examples for a field in CRD? kubectl explain CRD.FIELD
doesn't show example section. for example:
....
gitBranchName:
default: main
description: Git branch name that will be used for building your app.
example: main
type: string
kubectl explain crdName.spec.gitBranchName
results to:
...
FIELD: gitBranchName <string>
DESCRIPTION:
Git branch name that will be used for building your app.
It's useful for users to see examples of field in explain command.
This issue is currently awaiting triage.
SIG CLI takes a lead on issue triage for this repo, but any Kubernetes member can accept issues by applying the triage/accepted
label.
The triage/accepted
label can be added by org members by writing /triage accepted
in a comment.
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.
Add the --recursive flag to display all of the fields at once without descriptions. Information about each field is
retrieved from the server in OpenAPI format.
This is not what i'm looking for. I want to see field.example's value in kubectl explain
of field. for example:
kubectl explain crdName.spec.gitBranchName
results to sth like:
FIELD: gitBranchName <string>
DESCRIPTION:
Git branch name that will be used for building your app.
EXAMPLE: main
What is your kubectl version?(it is important because older versions look at openapi/v2 and newer versions use openapi/v3). Have you checked that openapi include example
field and kubectl explain just does not render it or there isn't any such field in openapi(in this case, there is nothing we can do and we can close this as not a bug.)
/triage needs-information
The Kubernetes project currently lacks enough contributors to adequately respond to all issues.
This bot triages un-triaged issues according to the following rules:
- After 90d of inactivity,
lifecycle/stale
is applied - After 30d of inactivity since
lifecycle/stale
was applied,lifecycle/rotten
is applied - After 30d of inactivity since
lifecycle/rotten
was applied, the issue is closed
You can:
- Mark this issue as fresh with
/remove-lifecycle stale
- Close this issue with
/close
- Offer to help out with Issue Triage
Please send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle stale
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues.
This bot triages un-triaged issues according to the following rules:
- After 90d of inactivity,
lifecycle/stale
is applied - After 30d of inactivity since
lifecycle/stale
was applied,lifecycle/rotten
is applied - After 30d of inactivity since
lifecycle/rotten
was applied, the issue is closed
You can:
- Mark this issue as fresh with
/remove-lifecycle rotten
- Close this issue with
/close
- Offer to help out with Issue Triage
Please send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle rotten