From 326be4a1d63ce75c5983490ffc9b2d9bbbebadde Mon Sep 17 00:00:00 2001 From: Yuhang Wei Date: Tue, 19 Dec 2023 20:18:37 +0800 Subject: [PATCH] perf(crd): improve default display of crd under kubectl get kubectl get os|osinstance doesn't display any valuable information. Adding default printer columns in crd.yaml to display more helpful information such as osversion, config version etc. Signed-off-by: Yuhang Wei --- .../config/crd/upgrade.openeuler.org_os.yaml | 13 ++++++++++++ .../upgrade.openeuler.org_osinstances.yaml | 21 +++++++++++++++++++ 2 files changed, 34 insertions(+) diff --git a/docs/example/config/crd/upgrade.openeuler.org_os.yaml b/docs/example/config/crd/upgrade.openeuler.org_os.yaml index acc70fc0..98ef1f56 100644 --- a/docs/example/config/crd/upgrade.openeuler.org_os.yaml +++ b/docs/example/config/crd/upgrade.openeuler.org_os.yaml @@ -17,6 +17,19 @@ spec: scope: Namespaced versions: - name: v1alpha1 + additionalPrinterColumns: + - name: OSVersion + jsonPath: .spec.osversion + type: string + description: The version of OS + - name: SYSCONFIG VERSION + type: string + jsonPath: .spec.sysconfigs.version + description: The version of sysconfig + - name: UPGRADECONFIG VERSION + type: string + jsonPath: .spec.upgradeconfigs.version + description: The version of upgradeconfig schema: openAPIV3Schema: description: OS is a specification for OS in the cluster diff --git a/docs/example/config/crd/upgrade.openeuler.org_osinstances.yaml b/docs/example/config/crd/upgrade.openeuler.org_osinstances.yaml index 3fa70c07..a7bad3f0 100644 --- a/docs/example/config/crd/upgrade.openeuler.org_osinstances.yaml +++ b/docs/example/config/crd/upgrade.openeuler.org_osinstances.yaml @@ -17,6 +17,27 @@ spec: scope: Namespaced versions: - name: v1alpha1 + additionalPrinterColumns: + - name: NODESTATUS + type: string + jsonPath: .spec.nodestatus + description: The status of node + - name: SYSCONFIG STATUS + type: string + jsonPath: .status.sysconfigs.version + description: The current status of sysconfig + - name: SYSCONFIG SPEC + type: string + jsonPath: .spec.sysconfigs.version + description: The expected version of sysconfig + - name: UPGRADECONFIG STATUS + type: string + jsonPath: .status.upgradeconfigs.version + description: The current version of upgradeconfig + - name: UPGRADECONFIG SPEC + type: string + jsonPath: .spec.upgradeconfigs.version + description: The expected version of upgradeconfig schema: openAPIV3Schema: description: OSInstance defines some infomation of a node -- Gitee