Skip to content

Commit 9e3ecf0

Browse files
committed
*.: change kind type cluster to mysqlcluster #249
1 parent 767f476 commit 9e3ecf0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+311
-311
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ RUN go env -w GOPROXY=https://goproxy.cn,direct; \
1313
# Copy the go source
1414
COPY cmd/manager/main.go cmd/manager/main.go
1515
COPY api/ api/
16-
COPY cluster/ cluster/
16+
COPY mysqlcluster/ mysqlcluster/
1717
COPY controllers/ controllers/
1818
COPY backup/ backup/
1919
COPY internal/ internal/

PROJECT

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ resources:
1010
controller: true
1111
domain: radondb.com
1212
group: mysql
13-
kind: Cluster
13+
kind: MysqlCluster
1414
path: github.com/radondb/radondb-mysql-kubernetes/api/v1alpha1
1515
version: v1alpha1
1616
- controller: true

api/v1alpha1/backup_types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ type BackupSpec struct {
3737
// HostName represents the host for which to take backup
3838
HostName string `json:"hostname"`
3939

40-
// Cluster represents the cluster name to backup
40+
// ClusterName represents the cluster name to backup
4141
ClusterName string `json:"clustname"`
4242

4343
// History Limit of job

api/v1alpha1/cluster_types.go renamed to api/v1alpha1/mysqlcluster_types.go

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ import (
2424
// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN!
2525
// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.
2626

27-
// ClusterSpec defines the desired state of Cluster
28-
type ClusterSpec struct {
27+
// MysqlClusterSpec defines the desired state of MysqlCluster
28+
type MysqlClusterSpec struct {
2929
// INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
3030
// Important: Run "make" to regenerate code after modifying this file
3131

@@ -313,8 +313,8 @@ const (
313313
NodeConditionReplicating NodeConditionType = "Replicating"
314314
)
315315

316-
// ClusterStatus defines the observed state of Cluster
317-
type ClusterStatus struct {
316+
// MysqlClusterStatus defines the observed state of MysqlCluster
317+
type MysqlClusterStatus struct {
318318
// INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
319319
// Important: Run "make" to regenerate code after modifying this file
320320

@@ -335,24 +335,24 @@ type ClusterStatus struct {
335335
// +kubebuilder:printcolumn:name="Replicas",type="integer",JSONPath=".spec.replicas",description="The number of desired nodes"
336336
// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp"
337337
// +kubebuilder:resource:shortName=mysql
338-
// Cluster is the Schema for the clusters API
339-
type Cluster struct {
338+
// MysqlCluster is the Schema for the mysqlclusters API
339+
type MysqlCluster struct {
340340
metav1.TypeMeta `json:",inline"`
341341
metav1.ObjectMeta `json:"metadata,omitempty"`
342342

343-
Spec ClusterSpec `json:"spec,omitempty"`
344-
Status ClusterStatus `json:"status,omitempty"`
343+
Spec MysqlClusterSpec `json:"spec,omitempty"`
344+
Status MysqlClusterStatus `json:"status,omitempty"`
345345
}
346346

347347
// +kubebuilder:object:root=true
348348

349-
// ClusterList contains a list of Cluster
350-
type ClusterList struct {
349+
// MysqlClusterList contains a list of MysqlCluster
350+
type MysqlClusterList struct {
351351
metav1.TypeMeta `json:",inline"`
352352
metav1.ListMeta `json:"metadata,omitempty"`
353-
Items []Cluster `json:"items"`
353+
Items []MysqlCluster `json:"items"`
354354
}
355355

356356
func init() {
357-
SchemeBuilder.Register(&Cluster{}, &ClusterList{})
357+
SchemeBuilder.Register(&MysqlCluster{}, &MysqlClusterList{})
358358
}

api/v1alpha1/zz_generated.deepcopy.go

Lines changed: 64 additions & 64 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

charts/mysql-operator/crds/mysql.radondb.com_backups.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ spec:
3737
description: BackupSpec defines the desired state of Backup
3838
properties:
3939
clustname:
40-
description: Cluster represents the cluster name to backup
40+
description: ClusterName represents the cluster name to backup
4141
type: string
4242
historyLimit:
4343
default: 3

config/crd/bases/mysql.radondb.com_clusters.yaml renamed to charts/mysql-operator/crds/mysql.radondb.com_mysqlclusters.yaml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,16 @@ metadata:
66
annotations:
77
controller-gen.kubebuilder.io/version: v0.4.1
88
creationTimestamp: null
9-
name: clusters.mysql.radondb.com
9+
name: mysqlclusters.mysql.radondb.com
1010
spec:
1111
group: mysql.radondb.com
1212
names:
13-
kind: Cluster
14-
listKind: ClusterList
15-
plural: clusters
13+
kind: MysqlCluster
14+
listKind: MysqlClusterList
15+
plural: mysqlclusters
1616
shortNames:
1717
- mysql
18-
singular: cluster
18+
singular: mysqlcluster
1919
scope: Namespaced
2020
versions:
2121
- additionalPrinterColumns:
@@ -33,7 +33,7 @@ spec:
3333
name: v1alpha1
3434
schema:
3535
openAPIV3Schema:
36-
description: Cluster is the Schema for the clusters API
36+
description: MysqlCluster is the Schema for the mysqlclusters API
3737
properties:
3838
apiVersion:
3939
description: 'APIVersion defines the versioned schema of this representation
@@ -48,7 +48,7 @@ spec:
4848
metadata:
4949
type: object
5050
spec:
51-
description: ClusterSpec defines the desired state of Cluster
51+
description: MysqlClusterSpec defines the desired state of MysqlCluster
5252
properties:
5353
backupSecretName:
5454
description: Represents the name of the secret that contains credentials
@@ -1309,7 +1309,7 @@ spec:
13091309
type: object
13101310
type: object
13111311
status:
1312-
description: ClusterStatus defines the observed state of Cluster
1312+
description: MysqlClusterStatus defines the observed state of MysqlCluster
13131313
properties:
13141314
conditions:
13151315
description: Conditions contains the list of the cluster conditions

charts/mysql-operator/templates/NOTES.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
You can create a new cluster by issuing:
1+
You can create a new mysqlcluster by issuing:
22

33
cat <<EOF | kubectl apply -f-
44
apiVersion: mysql.radondb.com/v1alpha1
5-
kind: Cluster
5+
kind: MysqlCluster
66
metadata:
77
name: sample
88
spec:

charts/mysql-operator/templates/cluster_rbac.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ rules:
7676
- apiGroups:
7777
- mysql.radondb.com
7878
resources:
79-
- clusters
79+
- mysqlclusters
8080
verbs:
8181
- create
8282
- delete
@@ -88,13 +88,13 @@ rules:
8888
- apiGroups:
8989
- mysql.radondb.com
9090
resources:
91-
- clusters/finalizers
91+
- mysqlclusters/finalizers
9292
verbs:
9393
- update
9494
- apiGroups:
9595
- mysql.radondb.com
9696
resources:
97-
- clusters/status
97+
- mysqlclusters/status
9898
verbs:
9999
- get
100100
- patch

0 commit comments

Comments
 (0)