Commit Graph

11 Commits

Author SHA1 Message Date
Alexander Zielenski b0d33eb1b8 refactor generator
refactor funcs out of generator

Kubernetes-commit: f37f63ab9fff8c38b4c0df6a7a420d1ed710ffe5
2022-11-02 20:34:12 -07:00
Alexander Zielenski c9325dd23a unit test v2 explain package
update

Kubernetes-commit: 0cf7240f313f831a7411abc878b7d7309e445487
2022-10-17 13:59:17 -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
Alexander Zielenski 7f1795f661 openapi v3 basic renderer
Kubernetes-commit: a9c093b16560a9ed50668250fd24889e503f2d8f
2022-10-17 13:58:42 -07:00
Sebastian Laskawiec cd508979c1 Fix printing control character in kubectl explain
Kubernetes-commit: e4dbaef3ccbd88d9e65befd8d0d666a793509ea2
2022-01-20 15:04:15 +01:00
Davanum Srinivas 12c6b0404d Check in OWNERS modified by update-yamlfmt.sh
Signed-off-by: Davanum Srinivas <davanum@gmail.com>

Kubernetes-commit: 9405e9b55ebcd461f161859a698b949ea3bde31d
2021-12-09 21:31:26 -05:00
c00522440 961082a1c3 clean true judge
del annotation

reback change

reback change

fix ci

Kubernetes-commit: 082aa9328f8f97f27be6e477df217b7265e8f260
2021-04-27 20:11:36 +08: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
Jordan Liggitt 610eeed98f Improve kubectl explain formatting-preservation
Kubernetes-commit: a22b6400a1492781aedecb79002718e3fbb023dc
2020-06-05 00:46:51 -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 171822aafc Move pkg/kubect/explain to staging
Kubernetes-commit: 1252ab3c983d8e4f1de18ffbf57b799e5882a8d1
2019-07-29 14:57:41 -07:00