Skip to content

Commit

Permalink
feat(crdr): enable disaster recovery integration
Browse files Browse the repository at this point in the history
This reverts commit fa2ce0d.
  • Loading branch information
byashimov committed Jan 22, 2025
1 parent d4277c8 commit 9b21492
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 3 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ nav_order: 1
<!-- Always keep the following header in place: -->
<!--## [MAJOR.MINOR.PATCH] - YYYY-MM-DD -->

## [MAJOR.MINOR.PATCH] - YYYY-MM-DD

- Add `disaster_recovery` service integration type support

## [4.33.0] - 2025-01-16

Expand Down
2 changes: 1 addition & 1 deletion docs/resources/pg.md
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ Optional:

Required:

- `integration_type` (String) Type of the service integration. The possible value is `read_replica`.
- `integration_type` (String) Type of the service integration. The possible values are `read_replica` and `disaster_recovery`.
- `source_service_name` (String) Name of the source service


Expand Down
4 changes: 4 additions & 0 deletions internal/schemautil/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,10 @@ func getBootstrapIntegrationTypes(kind string) []service.IntegrationType {
list = append(list, service.IntegrationTypeReadReplica)
}

if kind == ServiceTypePG {
list = append(list, service.IntegrationTypeDisasterRecovery)
}

return list
}

Expand Down
4 changes: 3 additions & 1 deletion internal/schemautil/wait.go
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,9 @@ func backupsReady(s *service.ServiceGetOut) bool {
// See https://github.com/aiven/terraform-provider-aiven/pull/172
for _, i := range s.ServiceIntegrations {
switch i.IntegrationType {
case service.IntegrationTypeReadReplica:
case service.IntegrationTypeReadReplica, service.IntegrationTypeDisasterRecovery:
// fixme: disaster recovery will have a backup eventually,
// remove this when BE is ready
if lo.FromPtr(i.DestService) == s.ServiceName {
return true
}
Expand Down
1 change: 0 additions & 1 deletion internal/sdkprovider/service/pg/pg_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1090,7 +1090,6 @@ func testAccCheckAivenServicePGAttributes(n string) resource.TestCheckFunc {
}

func TestAccAivenServicePG_disaster_recovery(t *testing.T) {
t.Skip("the feature is disabled")
primaryName := "aiven_pg.primary"
secondaryName := "aiven_pg.secondary"
projectName := os.Getenv("AIVEN_PROJECT_NAME")
Expand Down

0 comments on commit 9b21492

Please sign in to comment.