Skip to content

Commit a2cf493

Browse files
authored
K8SPSMDB-297 remove PSMDBCluster from PerconaServerMongoDBBackupSpec (#1941)
* K8SPSMDB-297 remove PSMDBCluster from PerconaServerMongoDBBackupSpec * run generate manifest * fix e2e tests that used psmdb cluster name
1 parent ffa31c2 commit a2cf493

File tree

9 files changed

+4
-22
lines changed

9 files changed

+4
-22
lines changed

config/crd/bases/psmdb.percona.com_perconaservermongodbbackups.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,6 @@ spec:
6767
type: integer
6868
compressionType:
6969
type: string
70-
psmdbCluster:
71-
type: string
7270
storageName:
7371
type: string
7472
type:

deploy/bundle.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,6 @@ spec:
7171
type: integer
7272
compressionType:
7373
type: string
74-
psmdbCluster:
75-
type: string
7674
storageName:
7775
type: string
7876
type:

deploy/crd.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,6 @@ spec:
7171
type: integer
7272
compressionType:
7373
type: string
74-
psmdbCluster:
75-
type: string
7674
storageName:
7775
type: string
7876
type:

deploy/cw-bundle.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,6 @@ spec:
7171
type: integer
7272
compressionType:
7373
type: string
74-
psmdbCluster:
75-
type: string
7674
storageName:
7775
type: string
7876
type:

e2e-tests/custom-replset-name/conf/backup-minio.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ kind: PerconaServerMongoDBBackup
33
metadata:
44
name: backup-minio
55
spec:
6-
psmdbCluster: some-name
6+
clusterName: some-name
77
storageName: minio

e2e-tests/upgrade-sharded/conf/backup-minio.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,4 @@ metadata:
44
name: backup-minio
55
spec:
66
clusterName: upgrade-sharded
7-
psmdbCluster: upgrade-sharded # TODO: remove after 1.12 release
87
storageName: minio

e2e-tests/upgrade/conf/backup-minio.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,4 @@ metadata:
44
name: backup-minio
55
spec:
66
clusterName: upgrade
7-
psmdbCluster: upgrade # TODO: remove after 1.12 release
87
storageName: minio

e2e-tests/version-service/conf/crd.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,6 @@ spec:
7171
type: integer
7272
compressionType:
7373
type: string
74-
psmdbCluster:
75-
type: string
7674
storageName:
7775
type: string
7876
type:

pkg/apis/psmdb/v1/perconaservermongodbbackup_types.go

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ import (
1111

1212
// PerconaServerMongoDBBackupSpec defines the desired state of PerconaServerMongoDBBackup
1313
type PerconaServerMongoDBBackupSpec struct {
14-
// Deprecated: Use ClusterName instead
15-
PSMDBCluster string `json:"psmdbCluster,omitempty"` // TODO: Remove after v1.15
1614
ClusterName string `json:"clusterName,omitempty"`
1715
StorageName string `json:"storageName,omitempty"`
1816
Compression compress.CompressionType `json:"compressionType,omitempty"`
@@ -94,7 +92,7 @@ func (p *PerconaServerMongoDBBackup) CheckFields() error {
9492
return fmt.Errorf("spec storageName field is empty")
9593
}
9694
if len(p.Spec.GetClusterName()) == 0 {
97-
return fmt.Errorf("spec clusterName and deprecated psmdbCluster fields are empty")
95+
return fmt.Errorf("spec clusterName is empty")
9896
}
9997
if string(p.Spec.Type) == "" {
10098
p.Spec.Type = defs.LogicalBackup
@@ -120,11 +118,7 @@ func (p *PerconaServerMongoDBBackup) IsBackupTypeIncrementalBase() bool {
120118
return p.Spec.Type == BackupTypeIncrementalBase
121119
}
122120

123-
// GetClusterName returns ClusterName if it's not empty. Otherwise, it will return PSMDBCluster.
124-
// TODO: Remove after v1.15
121+
// GetClusterName returns ClusterName.
125122
func (p *PerconaServerMongoDBBackupSpec) GetClusterName() string {
126-
if len(p.ClusterName) > 0 {
127-
return p.ClusterName
128-
}
129-
return p.PSMDBCluster
123+
return p.ClusterName
130124
}

0 commit comments

Comments
 (0)