Skip to content

Commit

Permalink
Merge pull request #479 from runkecheng/feature_additionalPrinterColumns
Browse files Browse the repository at this point in the history
crd: Add more `additionalPrinterColumns`. #476
  • Loading branch information
andyli029 authored May 12, 2022
2 parents 4624e6e + a70bb6d commit 3d0df14
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 10 deletions.
6 changes: 4 additions & 2 deletions api/v1alpha1/mysqlcluster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -373,8 +373,10 @@ type MysqlClusterStatus struct {
// +kubebuilder:object:root=true
// +kubebuilder:subresource:status
// +kubebuilder:subresource:scale:specpath=.spec.replicas,statuspath=.status.readyNodes
// +kubebuilder:printcolumn:name="Ready",type="string",JSONPath=".status.conditions[?(@.type == 'Ready')].status",description="The cluster status"
// +kubebuilder:printcolumn:name="Replicas",type="integer",JSONPath=".spec.replicas",description="The number of desired nodes"
// +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="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
// MysqlCluster is the Schema for the mysqlclusters API
Expand Down
16 changes: 12 additions & 4 deletions charts/mysql-operator/crds/mysql.radondb.com_mysqlclusters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,21 @@ spec:
versions:
- additionalPrinterColumns:
- description: The cluster status
jsonPath: .status.conditions[?(@.type == 'Ready')].status
name: Ready
jsonPath: .status.state
name: State
type: string
- description: The number of desired nodes
- description: The number of desired replicas
jsonPath: .spec.replicas
name: Replicas
name: Desired
type: integer
- description: The number of current replicas
jsonPath: .status.readyNodes
name: Current
type: integer
- description: Name of the leader node
jsonPath: .status.nodes[?(@.raftStatus.role == 'LEADER')].name
name: Leader
type: string
- jsonPath: .metadata.creationTimestamp
name: Age
type: date
Expand Down
16 changes: 12 additions & 4 deletions config/crd/bases/mysql.radondb.com_mysqlclusters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,21 @@ spec:
versions:
- additionalPrinterColumns:
- description: The cluster status
jsonPath: .status.conditions[?(@.type == 'Ready')].status
name: Ready
jsonPath: .status.state
name: State
type: string
- description: The number of desired nodes
- description: The number of desired replicas
jsonPath: .spec.replicas
name: Replicas
name: Desired
type: integer
- description: The number of current replicas
jsonPath: .status.readyNodes
name: Current
type: integer
- description: Name of the leader node
jsonPath: .status.nodes[?(@.raftStatus.role == 'LEADER')].name
name: Leader
type: string
- jsonPath: .metadata.creationTimestamp
name: Age
type: date
Expand Down

0 comments on commit 3d0df14

Please sign in to comment.