From 35638918896ff00316ecc99f27a02240f1bb72ed Mon Sep 17 00:00:00 2001 From: andy Date: Wed, 25 May 2022 19:26:08 +0800 Subject: [PATCH] *: fix typo and comments #494 --- api/v1alpha1/backup_types.go | 2 +- api/v1alpha1/mysqlcluster_types.go | 1 - api/v1alpha1/mysqlcluster_webhook.go | 3 +-- charts/mysql-operator/crds/mysql.radondb.com_backups.yaml | 4 ++-- config/crd/bases/mysql.radondb.com_backups.yaml | 4 ++-- config/samples/mysql_v1alpha1_backup.yaml | 2 +- docs/en-us/deploy_backup_restore_s3.md | 4 ++-- docs/zh-cn/deploy_backup_restore_s3.md | 4 ++-- 8 files changed, 11 insertions(+), 13 deletions(-) diff --git a/api/v1alpha1/backup_types.go b/api/v1alpha1/backup_types.go index 48622e4c..3fd8fa79 100644 --- a/api/v1alpha1/backup_types.go +++ b/api/v1alpha1/backup_types.go @@ -43,7 +43,7 @@ type BackupSpec struct { NFSServerAddress string `json:"nfsServerAddress,omitempty"` // ClusterName represents the cluster name to backup - ClusterName string `json:"clustname"` + ClusterName string `json:"clusterName"` // History Limit of job // +optional diff --git a/api/v1alpha1/mysqlcluster_types.go b/api/v1alpha1/mysqlcluster_types.go index d768a62e..65e29934 100644 --- a/api/v1alpha1/mysqlcluster_types.go +++ b/api/v1alpha1/mysqlcluster_types.go @@ -389,7 +389,6 @@ type MysqlCluster struct { } // +kubebuilder:object:root=true - // MysqlClusterList contains a list of MysqlCluster type MysqlClusterList struct { metav1.TypeMeta `json:",inline"` diff --git a/api/v1alpha1/mysqlcluster_webhook.go b/api/v1alpha1/mysqlcluster_webhook.go index 7b84e9ed..14c89d00 100644 --- a/api/v1alpha1/mysqlcluster_webhook.go +++ b/api/v1alpha1/mysqlcluster_webhook.go @@ -79,7 +79,6 @@ func (r *MysqlCluster) ValidateDelete() error { // Validate volume size, forbidden shrink storage size. func (r *MysqlCluster) validateVolumeSize(oldCluster *MysqlCluster) error { - oldStorageSize, err := resource.ParseQuantity(oldCluster.Spec.Persistence.Size) if err != nil { return err @@ -88,7 +87,7 @@ func (r *MysqlCluster) validateVolumeSize(oldCluster *MysqlCluster) error { if err != nil { return err } - // =1 means that old storage size is greater then new + // =1 means that old storage size is greater than new. if oldStorageSize.Cmp(newStorageSize) == 1 { return apierrors.NewForbidden(schema.GroupResource{}, "", fmt.Errorf("volesize can not be decreased")) } diff --git a/charts/mysql-operator/crds/mysql.radondb.com_backups.yaml b/charts/mysql-operator/crds/mysql.radondb.com_backups.yaml index c9cbca11..6967215b 100644 --- a/charts/mysql-operator/crds/mysql.radondb.com_backups.yaml +++ b/charts/mysql-operator/crds/mysql.radondb.com_backups.yaml @@ -36,7 +36,7 @@ spec: spec: description: BackupSpec defines the desired state of Backup properties: - clustname: + clusterName: description: ClusterName represents the cluster name to backup type: string historyLimit: @@ -56,7 +56,7 @@ spec: description: Represents the ip address of the nfs server. type: string required: - - clustname + - clusterName type: object status: description: BackupStatus defines the observed state of Backup diff --git a/config/crd/bases/mysql.radondb.com_backups.yaml b/config/crd/bases/mysql.radondb.com_backups.yaml index c9cbca11..6967215b 100644 --- a/config/crd/bases/mysql.radondb.com_backups.yaml +++ b/config/crd/bases/mysql.radondb.com_backups.yaml @@ -36,7 +36,7 @@ spec: spec: description: BackupSpec defines the desired state of Backup properties: - clustname: + clusterName: description: ClusterName represents the cluster name to backup type: string historyLimit: @@ -56,7 +56,7 @@ spec: description: Represents the ip address of the nfs server. type: string required: - - clustname + - clusterName type: object status: description: BackupStatus defines the observed state of Backup diff --git a/config/samples/mysql_v1alpha1_backup.yaml b/config/samples/mysql_v1alpha1_backup.yaml index 67d38d8d..bc85c7be 100644 --- a/config/samples/mysql_v1alpha1_backup.yaml +++ b/config/samples/mysql_v1alpha1_backup.yaml @@ -7,5 +7,5 @@ spec: image: radondb/mysql57-sidecar:v2.2.0 # hostname if empty, use the leader as hostname hostname: sample-mysql-0 - clustname: sample + clustername: sample # nfsServerAddress: "" diff --git a/docs/en-us/deploy_backup_restore_s3.md b/docs/en-us/deploy_backup_restore_s3.md index 0467012e..5f271766 100644 --- a/docs/en-us/deploy_backup_restore_s3.md +++ b/docs/en-us/deploy_backup_restore_s3.md @@ -51,13 +51,13 @@ metadata: spec: # Add fields here hostname: sample-mysql-0 - clustname: sample + clustername: sample ``` | name | function | |------|--------| |hostname|pod name in cluser| -|clustname|cluster name| +|clustername|cluster name| ### start cluster diff --git a/docs/zh-cn/deploy_backup_restore_s3.md b/docs/zh-cn/deploy_backup_restore_s3.md index aa80ac5e..d5487763 100644 --- a/docs/zh-cn/deploy_backup_restore_s3.md +++ b/docs/zh-cn/deploy_backup_restore_s3.md @@ -51,13 +51,13 @@ metadata: spec: # Add fields here hostname: sample-mysql-0 - clustname: sample + clustername: sample ``` | name | function | |------|--------| |hostname|pod name in cluser| -|clustname|cluster name| +|clustername|cluster name| ### start cluster