Skip to content

Commit 34ab7f0

Browse files
aballurijotruon
authored andcommitted
Added - Updating state of closed ADG Standby to not show as "Available"
1 parent c189ec2 commit 34ab7f0

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

internal/integrationtest/database_autonomous_database_resource_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1773,6 +1773,7 @@ func TestResourceDatabaseAutonomousDatabaseResource_dataGuard(t *testing.T) {
17731773
resource.TestCheckResourceAttr(resourceName, "license_model", "LICENSE_INCLUDED"),
17741774
resource.TestCheckResourceAttrSet(resourceName, "state"),
17751775
resource.TestCheckResourceAttrSet(resourceName, "time_local_data_guard_enabled"),
1776+
resource.TestCheckResourceAttr(resourceName, "standby_db.0.state", "STANDBY"),
17761777

17771778
func(s *terraform.State) (err error) {
17781779
resId2, err = acctest.FromInstanceState(s, resourceName, "id")

internal/service/database/database_autonomous_database_resource.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3287,7 +3287,7 @@ func (s *DatabaseAutonomousDatabaseResourceCrud) validateSwitchoverDatabase() er
32873287
fieldKeyFormat := fmt.Sprintf("%s.%d.%%s", "standby_db", 0)
32883288
if standbyState, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "state")); ok {
32893289
wantedStandByState := oci_database.AutonomousDatabaseStandbySummaryLifecycleStateEnum(strings.ToUpper(standbyState.(string)))
3290-
if wantedStandByState == oci_database.AutonomousDatabaseStandbySummaryLifecycleStateAvailable {
3290+
if (wantedStandByState == oci_database.AutonomousDatabaseStandbySummaryLifecycleStateAvailable) || (wantedStandByState == oci_database.AutonomousDatabaseStandbySummaryLifecycleStateStandby) {
32913291
if err := s.switchoverDatabase(""); err != nil {
32923292
s.D.Set("switchover_to", oldRaw.(string))
32933293
return err

0 commit comments

Comments
 (0)