Skip to content

Commit

Permalink
crd: Add additionalPrinterColumns. radondb#476
Browse files Browse the repository at this point in the history
New columns: Available
  • Loading branch information
runkecheng committed May 11, 2022
1 parent 421fa62 commit bbf02d5
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
1 change: 1 addition & 0 deletions api/v1alpha1/mysqlcluster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,7 @@ type Persistence struct {
// +kubebuilder:printcolumn:name="State",type="string",JSONPath=".status.state",description="The cluster status"
// +kubebuilder:printcolumn:name="SpecReplicas",type="integer",JSONPath=".spec.replicas",description="The number of desired nodes"
// +kubebuilder:printcolumn:name="ReadyNodes",type="integer",JSONPath=".status.readyNodes",description="The number of ready nodes"
// +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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ spec:
jsonPath: .status.readyNodes
name: ReadyNodes
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
Expand Down Expand Up @@ -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
Expand Down
6 changes: 4 additions & 2 deletions config/crd/bases/mysql.radondb.com_mysqlclusters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ spec:
jsonPath: .status.readyNodes
name: ReadyNodes
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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit bbf02d5

Please sign in to comment.