From b750bbdf077506366708dbbf99d420432bcef6b8 Mon Sep 17 00:00:00 2001 From: runkecheng <1131648942@qq.com> Date: Wed, 11 May 2022 11:19:54 +0800 Subject: [PATCH] crd: Add additionalPrinterColumns. #476 New columns: Available --- api/v1alpha1/mysqlcluster_types.go | 1 + .../crds/mysql.radondb.com_mysqlclusters.yaml | 6 ++++-- config/crd/bases/mysql.radondb.com_mysqlclusters.yaml | 6 ++++-- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/api/v1alpha1/mysqlcluster_types.go b/api/v1alpha1/mysqlcluster_types.go index 1d5ddc7f..1abcc62e 100644 --- a/api/v1alpha1/mysqlcluster_types.go +++ b/api/v1alpha1/mysqlcluster_types.go @@ -253,6 +253,7 @@ type Persistence struct { // +kubebuilder:printcolumn:name="State",type="string",JSONPath=".status.state",description="The cluster status" // +kubebuilder:printcolumn:name="Desired",type="integer",JSONPath=".spec.replicas",description="The number of desired replicas" // +kubebuilder:printcolumn:name="Current",type="integer",JSONPath=".status.readyNodes",description="The number of current replicas" +// +kubebuilder:printcolumn:name="Available",type="string",JSONPath=".status.conditions[?(@.type == 'Available')].status" // +kubebuilder:printcolumn:name="Leader",type="string",JSONPath=".status.nodes[?(@.raftStatus.role == 'LEADER')].name",description="Name of the leader node" // +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp" // +kubebuilder:resource:shortName=mysql diff --git a/charts/mysql-operator/crds/mysql.radondb.com_mysqlclusters.yaml b/charts/mysql-operator/crds/mysql.radondb.com_mysqlclusters.yaml index c338ba0e..13a2e7de 100644 --- a/charts/mysql-operator/crds/mysql.radondb.com_mysqlclusters.yaml +++ b/charts/mysql-operator/crds/mysql.radondb.com_mysqlclusters.yaml @@ -31,6 +31,9 @@ spec: jsonPath: .status.readyNodes name: Current type: integer + - jsonPath: .status.conditions[?(@.type == 'Available')].status + name: Available + type: string - description: Name of the leader node jsonPath: .status.nodes[?(@.raftStatus.role == 'LEADER')].name name: Leader @@ -1346,8 +1349,7 @@ spec: \"Unknown\"). type: string type: - description: Type of cluster condition, values in (\"Initializing\", - \"Ready\", \"Error\"). + description: Type of cluster condition. type: string required: - lastTransitionTime diff --git a/config/crd/bases/mysql.radondb.com_mysqlclusters.yaml b/config/crd/bases/mysql.radondb.com_mysqlclusters.yaml index c338ba0e..13a2e7de 100644 --- a/config/crd/bases/mysql.radondb.com_mysqlclusters.yaml +++ b/config/crd/bases/mysql.radondb.com_mysqlclusters.yaml @@ -31,6 +31,9 @@ spec: jsonPath: .status.readyNodes name: Current type: integer + - jsonPath: .status.conditions[?(@.type == 'Available')].status + name: Available + type: string - description: Name of the leader node jsonPath: .status.nodes[?(@.raftStatus.role == 'LEADER')].name name: Leader @@ -1346,8 +1349,7 @@ spec: \"Unknown\"). type: string type: - description: Type of cluster condition, values in (\"Initializing\", - \"Ready\", \"Error\"). + description: Type of cluster condition. type: string required: - lastTransitionTime