Skip to content

Commit 9b8bdf6

Browse files
authored
ROX-27922: add test to ensure RDS restore when final snapshot exists (#2289)
add test to make sure RDS is restored when a final snapshot exists
1 parent f616638 commit 9b8bdf6

File tree

3 files changed

+28801
-1
lines changed

3 files changed

+28801
-1
lines changed

fleetshard/pkg/central/cloudprovider/awsclient/rds.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,21 @@ import (
1212
"github.com/aws/aws-sdk-go/aws/awserr"
1313
"github.com/aws/aws-sdk-go/aws/session"
1414
"github.com/aws/aws-sdk-go/service/rds"
15+
"github.com/aws/aws-sdk-go/service/rds/rdsiface"
1516
"github.com/golang/glog"
1617
"github.com/stackrox/acs-fleet-manager/fleetshard/config"
1718
"github.com/stackrox/acs-fleet-manager/fleetshard/pkg/central/cloudprovider"
1819
"github.com/stackrox/acs-fleet-manager/fleetshard/pkg/central/postgres"
1920
"k8s.io/apimachinery/pkg/util/rand"
2021
)
2122

23+
// RDSClient is a wrapper around the rdsiface.RDSAPI to generate a mock
24+
//
25+
//go:generate moq -out rds_client_moq.go . RDSClient
26+
type RDSClient interface {
27+
rdsiface.RDSAPI
28+
}
29+
2230
const (
2331
dbAvailableStatus = "available"
2432
dbDeletingStatus = "deleting"
@@ -60,7 +68,7 @@ type RDS struct {
6068
performanceInsights bool
6169
dataplaneClusterName string
6270

63-
rdsClient *rds.RDS
71+
rdsClient rdsiface.RDSAPI
6472
}
6573

6674
// EnsureDBProvisioned is a blocking function that makes sure that an RDS database was provisioned for a Central

0 commit comments

Comments
 (0)