Skip to content

Commit

Permalink
Merge pull request radondb#261 from hustjieke/feature_change_kind_clu…
Browse files Browse the repository at this point in the history
…ster_to_mysqlcluster_#249

*.: change kind type cluster to mysqlcluster radondb#249
  • Loading branch information
andyli029 authored Oct 18, 2021
2 parents ab9e91e + df620e1 commit 20746b1
Show file tree
Hide file tree
Showing 56 changed files with 311 additions and 311 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ RUN go env -w GOPROXY=https://goproxy.cn,direct; \
# Copy the go source
COPY cmd/manager/main.go cmd/manager/main.go
COPY api/ api/
COPY cluster/ cluster/
COPY mysqlcluster/ mysqlcluster/
COPY controllers/ controllers/
COPY backup/ backup/
COPY internal/ internal/
Expand Down
2 changes: 1 addition & 1 deletion PROJECT
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ resources:
controller: true
domain: radondb.com
group: mysql
kind: Cluster
kind: MysqlCluster
path: github.com/radondb/radondb-mysql-kubernetes/api/v1alpha1
version: v1alpha1
- controller: true
Expand Down
2 changes: 1 addition & 1 deletion api/v1alpha1/backup_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ type BackupSpec struct {
// HostName represents the host for which to take backup
HostName string `json:"hostname"`

// Cluster represents the cluster name to backup
// ClusterName represents the cluster name to backup
ClusterName string `json:"clustname"`

// History Limit of job
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ import (
// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN!
// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.

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

Expand Down Expand Up @@ -313,8 +313,8 @@ const (
NodeConditionReplicating NodeConditionType = "Replicating"
)

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

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

Spec ClusterSpec `json:"spec,omitempty"`
Status ClusterStatus `json:"status,omitempty"`
Spec MysqlClusterSpec `json:"spec,omitempty"`
Status MysqlClusterStatus `json:"status,omitempty"`
}

// +kubebuilder:object:root=true

// ClusterList contains a list of Cluster
type ClusterList struct {
// MysqlClusterList contains a list of MysqlCluster
type MysqlClusterList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []Cluster `json:"items"`
Items []MysqlCluster `json:"items"`
}

func init() {
SchemeBuilder.Register(&Cluster{}, &ClusterList{})
SchemeBuilder.Register(&MysqlCluster{}, &MysqlClusterList{})
}
128 changes: 64 additions & 64 deletions api/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion charts/mysql-operator/crds/mysql.radondb.com_backups.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ spec:
description: BackupSpec defines the desired state of Backup
properties:
clustname:
description: Cluster represents the cluster name to backup
description: ClusterName represents the cluster name to backup
type: string
historyLimit:
default: 3
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@ metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.4.1
creationTimestamp: null
name: clusters.mysql.radondb.com
name: mysqlclusters.mysql.radondb.com
spec:
group: mysql.radondb.com
names:
kind: Cluster
listKind: ClusterList
plural: clusters
kind: MysqlCluster
listKind: MysqlClusterList
plural: mysqlclusters
shortNames:
- mysql
singular: cluster
singular: mysqlcluster
scope: Namespaced
versions:
- additionalPrinterColumns:
Expand All @@ -33,7 +33,7 @@ spec:
name: v1alpha1
schema:
openAPIV3Schema:
description: Cluster is the Schema for the clusters API
description: MysqlCluster is the Schema for the mysqlclusters API
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
Expand All @@ -48,7 +48,7 @@ spec:
metadata:
type: object
spec:
description: ClusterSpec defines the desired state of Cluster
description: MysqlClusterSpec defines the desired state of MysqlCluster
properties:
backupSecretName:
description: Represents the name of the secret that contains credentials
Expand Down Expand Up @@ -1309,7 +1309,7 @@ spec:
type: object
type: object
status:
description: ClusterStatus defines the observed state of Cluster
description: MysqlClusterStatus defines the observed state of MysqlCluster
properties:
conditions:
description: Conditions contains the list of the cluster conditions
Expand Down
4 changes: 2 additions & 2 deletions charts/mysql-operator/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
You can create a new cluster by issuing:
You can create a new mysqlcluster by issuing:

cat <<EOF | kubectl apply -f-
apiVersion: mysql.radondb.com/v1alpha1
kind: Cluster
kind: MysqlCluster
metadata:
name: sample
spec:
Expand Down
6 changes: 3 additions & 3 deletions charts/mysql-operator/templates/cluster_rbac.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ rules:
- apiGroups:
- mysql.radondb.com
resources:
- clusters
- mysqlclusters
verbs:
- create
- delete
Expand All @@ -88,13 +88,13 @@ rules:
- apiGroups:
- mysql.radondb.com
resources:
- clusters/finalizers
- mysqlclusters/finalizers
verbs:
- update
- apiGroups:
- mysql.radondb.com
resources:
- clusters/status
- mysqlclusters/status
verbs:
- get
- patch
Expand Down
Loading

0 comments on commit 20746b1

Please sign in to comment.