mirror of
https://github.com/zalando/postgres-operator.git
synced 2026-10-01 06:43:15 +02:00
drop deprecated fields from Postgresql CRD (#3106)
* remove deprecated fields from postgresql CRD --------- Co-authored-by: ida-novindasari_zse <ida.novindasari@zalando.de> Co-authored-by: Mikkel Oscar Lyderik Larsen <mikkeloscar@users.noreply.github.com> Co-authored-by: idanovinda <idanovinda@gmail.com>
This commit is contained in:
co-authored by
ida-novindasari_zse
Mikkel Oscar Lyderik Larsen
idanovinda
parent
a3d17c12d2
commit
18e359b995
@@ -64,35 +64,6 @@ func TestControllerOwnershipOnPostgresql(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestMergeDeprecatedPostgreSQLSpecParameters(t *testing.T) {
|
||||
tests := []struct {
|
||||
name string
|
||||
in *acidv1.PostgresSpec
|
||||
out *acidv1.PostgresSpec
|
||||
error string
|
||||
}{
|
||||
{
|
||||
"Check that old parameters propagate values to the new ones",
|
||||
&acidv1.PostgresSpec{UseLoadBalancer: &True, ReplicaLoadBalancer: &True},
|
||||
&acidv1.PostgresSpec{UseLoadBalancer: nil, ReplicaLoadBalancer: nil,
|
||||
EnableMasterLoadBalancer: &True, EnableReplicaLoadBalancer: &True},
|
||||
"New parameters should be set from the values of old ones",
|
||||
},
|
||||
{
|
||||
"Check that new parameters are not set when both old and new ones are present",
|
||||
&acidv1.PostgresSpec{UseLoadBalancer: &True, EnableMasterLoadBalancer: &False},
|
||||
&acidv1.PostgresSpec{UseLoadBalancer: nil, EnableMasterLoadBalancer: &False},
|
||||
"New parameters should remain unchanged when both old and new are present",
|
||||
},
|
||||
}
|
||||
for _, tt := range tests {
|
||||
result := postgresqlTestController.mergeDeprecatedPostgreSQLSpecParameters(tt.in)
|
||||
if !reflect.DeepEqual(result, tt.out) {
|
||||
t.Errorf("%s: %v", tt.name, tt.error)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestMeetsClusterDeleteAnnotations(t *testing.T) {
|
||||
// set delete annotations in configuration
|
||||
postgresqlTestController.opConfig.DeleteAnnotationDateKey = "delete-date"
|
||||
|
||||
Reference in New Issue
Block a user