Skip to content

Commit

Permalink
Merge pull request #17 from qonto/add-rds-status
Browse files Browse the repository at this point in the history
Add creating and deleting statuses
  • Loading branch information
vmercierfr authored Oct 17, 2023
2 parents 8d37f37 + a98785a commit 59551d4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
6 changes: 5 additions & 1 deletion internal/app/rds/rds.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,10 @@ const (
InstanceStatusBackingUp int = 2
InstanceStatusStarting int = 3
InstanceStatusStopped int = 0
InstanceStatusStopping int = -2
InstanceStatusUnknown int = -1
InstanceStatusStopping int = -2
InstanceStatusCreating int = -3
InstanceStatusDeleting int = -4
NoPendingMaintenanceOperation string = "no"
UnscheduledPendingMaintenanceOperation string = "pending"
AutoAppliedPendingMaintenanceOperation string = "auto-applied"
Expand All @@ -76,6 +78,8 @@ const (
var instanceStatuses = map[string]int{
"available": InstanceStatusAvailable,
"backing-up": InstanceStatusBackingUp,
"creating": InstanceStatusCreating,
"deleting": InstanceStatusDeleting,
"starting": InstanceStatusStarting,
"stopped": InstanceStatusStopped,
"stopping": InstanceStatusStopping,
Expand Down
7 changes: 5 additions & 2 deletions internal/app/rds/rds_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -266,10 +266,13 @@ func TestGetDBInstanceStatusCode(t *testing.T) {

tests := []test{
{input: "available", want: rds.InstanceStatusAvailable},
{input: "stopped", want: rds.InstanceStatusStopped},
{input: "backing-up", want: rds.InstanceStatusBackingUp},
{input: "unknown", want: rds.InstanceStatusUnknown},
{input: "creating", want: rds.InstanceStatusCreating},
{input: "deleting", want: rds.InstanceStatusDeleting},
{input: "future", want: rds.InstanceStatusUnknown},
{input: "stopped", want: rds.InstanceStatusStopped},
{input: "stopping", want: rds.InstanceStatusStopping},
{input: "unknown", want: rds.InstanceStatusUnknown},
}

for _, tc := range tests {
Expand Down

0 comments on commit 59551d4

Please sign in to comment.