Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Backport release-0.47] fix(database): ignore restoreFrom in isUpToDate #2032

Merged
merged 1 commit into from
Apr 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions pkg/clients/database/rds.go
Original file line number Diff line number Diff line change
Expand Up @@ -712,6 +712,7 @@ func IsUpToDate(ctx context.Context, kube client.Client, r *v1beta1.RDSInstance,
cmpopts.IgnoreFields(v1beta1.RDSInstanceParameters{}, "Region"),
cmpopts.IgnoreFields(v1beta1.RDSInstanceParameters{}, "Tags"),
cmpopts.IgnoreFields(v1beta1.RDSInstanceParameters{}, "DBName"),
cmpopts.IgnoreFields(v1beta1.RDSInstanceParameters{}, "RestoreFrom"),
cmpopts.IgnoreFields(v1beta1.RDSInstanceParameters{}, "EngineVersion"),
cmpopts.IgnoreFields(v1beta1.RDSInstanceParameters{}, "SkipFinalSnapshotBeforeDeletion"),
cmpopts.IgnoreFields(v1beta1.RDSInstanceParameters{}, "FinalDBSnapshotIdentifier"),
Expand Down
23 changes: 23 additions & 0 deletions pkg/clients/database/rds_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ var (
port = 123
port32 = int32(port)
resourceID = "resource"
restoreFromSource = "PointInTime"
retention = 2
retention32 = int32(retention)
status = "testStatus"
Expand Down Expand Up @@ -281,6 +282,28 @@ func TestIsUpToDate(t *testing.T) {
},
want: true,
},
"IgnoresRestoreFrom": {
args: args{
db: rdstypes.DBInstance{
DBName: &dbName,
},
r: v1beta1.RDSInstance{
Spec: v1beta1.RDSInstanceSpec{
ForProvider: v1beta1.RDSInstanceParameters{
DBName: &dbName,
RestoreFrom: &v1beta1.RestoreBackupConfiguration{
PointInTime: &v1beta1.PointInTimeRestoreBackupConfiguration{
SourceDBInstanceIdentifier: &resourceID,
UseLatestRestorableTime: true,
},
Source: &restoreFromSource,
},
},
},
},
},
want: true,
},
"SamePassword": {
args: args{
db: rdstypes.DBInstance{
Expand Down
Loading