74 lines
2.8 KiB
Diff
74 lines
2.8 KiB
Diff
|
|
From 2c90e2e1fae25a8324cf527a71d7501b1d0b7921 Mon Sep 17 00:00:00 2001
|
||
|
|
From: Yuhang Wei <weiyuhang3@huawei.com>
|
||
|
|
Date: Fri, 26 Jan 2024 10:53:40 +0800
|
||
|
|
Subject: [PATCH 12/13] 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 <weiyuhang3@huawei.com>
|
||
|
|
---
|
||
|
|
.../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 3bb1333..2dd822e 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: OS VERSION
|
||
|
|
+ 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 3fa70c0..df9119b 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-VERSION-CURRENT
|
||
|
|
+ type: string
|
||
|
|
+ jsonPath: .status.sysconfigs.version
|
||
|
|
+ description: The current status of sysconfig
|
||
|
|
+ - name: SYSCONFIG-VERSION-DESIRED
|
||
|
|
+ type: string
|
||
|
|
+ jsonPath: .spec.sysconfigs.version
|
||
|
|
+ description: The expected version of sysconfig
|
||
|
|
+ - name: UPGRADECONFIG-VERSION-CURRENT
|
||
|
|
+ type: string
|
||
|
|
+ jsonPath: .status.upgradeconfigs.version
|
||
|
|
+ description: The current version of upgradeconfig
|
||
|
|
+ - name: UPGRADECONFIG-VERSION-DESIRED
|
||
|
|
+ type: string
|
||
|
|
+ jsonPath: .spec.upgradeconfigs.version
|
||
|
|
+ description: The expected version of upgradeconfig
|
||
|
|
schema:
|
||
|
|
openAPIV3Schema:
|
||
|
|
description: OSInstance defines some infomation of a node
|
||
|
|
--
|
||
|
|
2.34.1
|
||
|
|
|