diff --git a/api/v1alpha1/backup_types.go b/api/v1alpha1/backup_types.go index 48622e4c2..3fd8fa791 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 d768a62ef..48c30f4a4 100644 --- a/api/v1alpha1/mysqlcluster_types.go +++ b/api/v1alpha1/mysqlcluster_types.go @@ -388,8 +388,6 @@ type MysqlCluster struct { Status MysqlClusterStatus `json:"status,omitempty"` } -// +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 7b84e9ed2..14c89d001 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 c9cbca115..6967215b3 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 c9cbca115..6967215b3 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