Skip to content

Commit

Permalink
Add Ready print column to kubectl
Browse files Browse the repository at this point in the history
  • Loading branch information
AMecea committed Jul 8, 2019
1 parent d875bff commit 4c2d5ef
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions config/crds/mysql_v1alpha1_mysqlcluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ metadata:
name: mysqlclusters.mysql.presslabs.org
spec:
additionalPrinterColumns:
- JSONPath: .status.conditions[?(@.type == "Ready")].status
description: The cluster status
name: Ready
type: string
- JSONPath: .spec.replicas
description: The number of desired nodes
name: Replicas
Expand Down
4 changes: 4 additions & 0 deletions hack/charts/mysql-operator/templates/crds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ metadata:
helm.sh/hook: crd-install
spec:
additionalPrinterColumns:
- JSONPath: .status.conditions[?(@.type == "Ready")].status
description: The cluster status
name: Ready
type: string
- JSONPath: .spec.replicas
description: The number of desired nodes
name: Replicas
Expand Down
1 change: 1 addition & 0 deletions pkg/apis/mysql/v1alpha1/mysqlcluster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,7 @@ type MysqlClusterStatus struct {
// +k8s:openapi-gen=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="Age",type="date",JSONPath=".metadata.creationTimestamp"
type MysqlCluster struct {
Expand Down

0 comments on commit 4c2d5ef

Please sign in to comment.