Skip to content

Commit ea0826b

Browse files
committed
Update CRD description and add print column
1 parent ffb0a22 commit ea0826b

File tree

4 files changed

+26
-3
lines changed

4 files changed

+26
-3
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ bin/orc-helper_linux_amd64: $(shell hack/development/related-go-files.sh $(PKG_N
4848
skaffold-build: bin/mysql-operator_linux_amd64 bin/mysql-operator-sidecar_linux_amd64 bin/orc-helper_linux_amd64
4949

5050
skaffold-run: skaffold-build
51-
skaffold run
51+
skaffold run --cache-artifacts=true
5252

5353
# Run against the configured Kubernetes cluster in ~/.kube/config
5454
run: generate fmt vet

config/crds/mysql_v1alpha1_mysqlcluster.yaml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,14 @@ metadata:
66
controller-tools.k8s.io: "1.0"
77
name: mysqlclusters.mysql.presslabs.org
88
spec:
9+
additionalPrinterColumns:
10+
- JSONPath: .spec.replicas
11+
description: The number of desired nodes
12+
name: Replicas
13+
type: integer
14+
- JSONPath: .metadata.creationTimestamp
15+
name: Age
16+
type: date
917
group: mysql.presslabs.org
1018
names:
1119
kind: MysqlCluster
@@ -54,7 +62,8 @@ spec:
5462
type: string
5563
image:
5664
description: To specify the image that will be used for mysql server
57-
container. If this is specified then the mysqlVersion is ignored.
65+
container. If this is specified then the mysqlVersion is used as source
66+
for MySQL server version.
5867
type: string
5968
initBucketSecretName:
6069
type: string
@@ -80,7 +89,11 @@ spec:
8089
description: A map[string]string that will be passed to my.cnf file.
8190
type: object
8291
mysqlVersion:
83-
description: Represents the percona image tag. Defaults to 5.7
92+
description: 'Represents the MySQL version that will be run. The available
93+
version can be found here: https://github.com/presslabs/mysql-operator/blob/0fd4641ce4f756a0aab9d31c8b1f1c44ee10fcb2/pkg/util/constants/constants.go#L87
94+
This field should be set even if the Image is set to let the operator
95+
know which mysql version is running. Based on this version the operator
96+
can take decisions which features can be used. Defaults to 5.7'
8497
type: string
8598
podSpec:
8699
description: Pod extra specification

hack/charts/mysql-operator/templates/crds.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,14 @@ metadata:
3232
annotations:
3333
helm.sh/hook: crd-install
3434
spec:
35+
additionalPrinterColumns:
36+
- JSONPath: .spec.replicas
37+
description: The number of desired nodes
38+
name: Replicas
39+
type: integer
40+
- JSONPath: .metadata.creationTimestamp
41+
name: Age
42+
type: date
3543
group: mysql.presslabs.org
3644
names:
3745
kind: MysqlCluster

pkg/apis/mysql/v1alpha1/mysqlcluster_types.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,8 @@ type MysqlClusterStatus struct {
282282
// +k8s:openapi-gen=true
283283
// +kubebuilder:subresource:status
284284
// +kubebuilder:subresource:scale:specpath=.spec.replicas,statuspath=.status.readyNodes
285+
// +kubebuilder:printcolumn:name="Replicas",type="integer",JSONPath=".spec.replicas",description="The number of desired nodes"
286+
// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp"
285287
type MysqlCluster struct {
286288
metav1.TypeMeta `json:",inline"`
287289
metav1.ObjectMeta `json:"metadata,omitempty"`

0 commit comments

Comments
 (0)