Commit Graph

20 Commits

Author SHA1 Message Date
Akash 4106fc8791 Added shorthand for explain --output
Removed short flag example

Kubernetes-commit: 923a41370dc85062241fa149edda1307a16910e2
2024-10-05 03:19:57 +05:30
Sean Sullivan 5cdf0dd00c OpenAPIResourcesGetter allows lazy-loading OpenAPI V2
Kubernetes-commit: 2eb06e79ef3ac341bf660b86b390740977fc94e7
2023-03-13 20:28:40 -07:00
Arda Güçlü 042ec77890 Remove KUBECTL_EXPLAIN_OPENAPIV3 environment variable
Since explain openapiv3 has been moved to beta already, there is no
point to having this environment variable.

This PR removes it.

Kubernetes-commit: 4d8f569b037d2979c1d9c5825e5227aadfc8077f
2023-07-13 13:37:03 +03:00
Ritikaa96 d5606514d9 Adding review changs to update
Kubernetes-commit: fff5b35023b2b9cd9ec681e188c077225d1293a3
2023-06-16 16:33:07 +05:30
Ritikaa96 13f1a1e448 Updated kubectl explain help output
Kubernetes-commit: e213448db12abb91450028c89a9e8330d693a110
2023-06-14 12:33:18 +05:30
Ritikaa96 26d4d62bb1 Details added in kubectl explain help
Kubernetes-commit: 8c06ca68d7d3a286425ab89bcafb109e83199a94
2023-06-13 17:01:46 +05:30
Arda Güçlü 3f05cfcd78 Migrate genericclioptions.IOStreams usage to genericiooptions
Kubernetes-commit: 00c30941260a27e6929aef84c7fdbc8f1508518c
2023-04-05 14:07:46 +03:00
Alexander Zielenski 86033dd377 enable openapiv3 by default
Kubernetes-commit: ce3385ab1f9b0cce4d972b8888584dd0fe295c70
2023-03-08 13:15:56 -08:00
Alexander Zielenski dd44b643a3 kubectl: alias plaintext-openapiv2 to old explain
Kubernetes-commit: 8249a827bda6c7921ea7efa3a15b11ab6807fec0
2023-01-19 14:43:31 -08:00
Alexander Zielenski a56d6d4a49 refactor factory to support fake openapiv3
Kubernetes-commit: 81dd9e3d2565f827dae34d6aac24cca690d840d1
2023-01-23 19:09:43 -08:00
Katrina Verey 530dea246b Introduce CLI for ApplySet-based pruning (#115979)
* Introduce CLI for ApplySet-based pruning

* Address feedback from justinsb

* Fix parent namespace sourcing and restrict types. Increase test coverage.

Kubernetes-commit: 0dd346673c00158247c8232f9e81a308fb741463
2023-02-27 12:20:40 -05:00
Alexander Zielenski 3371c3ccee use discovery client from factory in explain v2
was making my own which was uncached

Kubernetes-commit: dca025f37c7d40388f6869fc3d04b8f4fab8d122
2022-11-03 18:59:09 -07:00
Alexander Zielenski 9cd0ccd733 add `KUBECTL_EXPLAIN_OPENAPIV3` envar to gate new explain implementation
update

Kubernetes-commit: 2f16cd4aeabda5dd6d5398a3592400bc249fdb17
2022-10-12 08:37:41 -07:00
Arda Güçlü 81a25f37b5 Set validate functions requiring no parameters for all commands
Validate function is used to validate command options and should not get
any additional parameter. To preserve compatibility across all
kubectl commands, this PR removes all parameters in validate functions.

Kubernetes-commit: 8fb423bfabe0d53934cc94c154c7da2dc3ce1332
2022-05-17 11:38:20 +03:00
Andrea Hoffer 09ed00ef49 Minor adjustments to descriptions and example text
Kubernetes-commit: 6b736f348483bb6b20d4633319305960f4d9e4c1
2021-07-06 15:05:26 -04:00
Jan Chaloupka ba75977126 kubectl explain: detect resource group in case there are two or more groups discovered
Assume the following CRDs exist (ordered by priority, the first is the highest):
- authentications.migration.k8s.io (K=Authentications, G=migration.k8s.io)
- authentications.metal3.io (K=Authentications, G=metal3.io)
- authentications.whereabouts.cni.cncf.io (K=Authentications, G=whereabouts.cni.cncf.io)
- authentications.snapshot.storage.k8s.io (K=Authentications, G=snapshot.storage.k8s.io)

In case 'kubectl explain authentications' is ran, the highest priority definition (in this case authentications.migration.k8s.io)
is returned. In case a user wants to explain authentication CRD of a different group, --api-version flag has to be set alongside
to point to a specific group and version. E.g. --api-version=metal3.io/v1

This PR allows to dismiss --api-version flag and perform a prefix check to select a resource (e.g. CRD) whose (resource, group) pair
fully prefixes requested resource. E.g. running 'kubectl explain authentications.metal3.io' will return
description of authentications.metal3.io. The same holds for optional field path.
I.e. 'kubectl explain authentications.metal3.io.spec' will return description of spec field
of authentications.metal3.io.spec. In case no resource match is found, the search falls back
to selecting the highest priority gvr that matches the resource.
In case --api-version is set, no prefix matching is performed. To cover cases
such as 'kubectl explain authentications.metal3.io --api-version=authentications.metal3.io/v1' where
fields path coincide with the resource fully specified name (to access .metal3.io field of authentications.metal3.io).

Kubernetes-commit: 30674db1595e3a24273ceb71cbfe67bb300ad951
2021-01-14 09:08:20 +01:00
Karl 'NaN' Wikström 38408eaa8c cleanup: use i18n.T on all command descriptions
cleanup: use i18n.T only on string literals

cleanup: sort imports

Add i18n dependency for wait.go

Remove translation on envResource

cleanup: translate string instead of variable

cleanup: sort imports

cleanup: translate string literal only

Kubernetes-commit: cc8428566ea7160c5b20410a1bee53ca7ddb998e
2020-10-09 13:16:13 +02:00
Sally O'Malley 87d74c1a63 clarify help for --api-version: note it's API group/version
Kubernetes-commit: 29cd320d89b286c175623a95dd7df8f2cd762c5d
2020-10-05 14:06:32 -04:00
knight42 b9bc004f47 fix(kubectl): explain crds with the same resource name with builtin objects
Kubernetes-commit: 397f107a0886999e0d45955dfe460112edd9ac5e
2020-03-26 16:07:06 +08:00
Sean Sullivan c6063dd846 Move pkg/kubectl/cmd/{command} to staging
Kubernetes-commit: 0e0ea523392f1121f61f99ac30a9bc2043eaed90
2019-08-01 11:01:40 -07:00