Skip to content

Commit

Permalink
fix(database): Ignore immutable field DBName in isUpToDate
Browse files Browse the repository at this point in the history
Signed-off-by: Maximilian Blatt (external expert on behalf of DB Netz) <[email protected]>
  • Loading branch information
MisterMX committed Nov 22, 2023
1 parent cafde90 commit 70d1618
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions pkg/clients/database/rds.go
Original file line number Diff line number Diff line change
Expand Up @@ -720,6 +720,7 @@ func IsUpToDate(ctx context.Context, kube client.Client, r *v1beta1.RDSInstance,
cmpopts.IgnoreTypes(&xpv1.Reference{}, &xpv1.Selector{}, []xpv1.Reference{}),
cmpopts.IgnoreFields(v1beta1.RDSInstanceParameters{}, "Region"),
cmpopts.IgnoreFields(v1beta1.RDSInstanceParameters{}, "Tags"),
cmpopts.IgnoreFields(v1beta1.RDSInstanceParameters{}, "DBName"),
cmpopts.IgnoreFields(v1beta1.RDSInstanceParameters{}, "EngineVersion"),
cmpopts.IgnoreFields(v1beta1.RDSInstanceParameters{}, "SkipFinalSnapshotBeforeDeletion"),
cmpopts.IgnoreFields(v1beta1.RDSInstanceParameters{}, "FinalDBSnapshotIdentifier"),
Expand Down
15 changes: 15 additions & 0 deletions pkg/clients/database/rds_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,21 @@ func TestIsUpToDate(t *testing.T) {
},
want: true,
},
"IgnoresDBName": {
args: args{
db: rdstypes.DBInstance{
DBName: nil,
},
r: v1beta1.RDSInstance{
Spec: v1beta1.RDSInstanceSpec{
ForProvider: v1beta1.RDSInstanceParameters{
DBName: &dbName,
},
},
},
},
want: true,
},
"SamePassword": {
args: args{
db: rdstypes.DBInstance{
Expand Down

0 comments on commit 70d1618

Please sign in to comment.