Skip to content

Commit

Permalink
[CLOUDGA-25217] Fix specifying is_default for regions (#150)
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-yb authored Jan 24, 2025
1 parent 7cb7962 commit 4f4f816
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion managed/resource_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -739,13 +739,15 @@ func createClusterSpec(ctx context.Context, apiClient *openapiclient.APIClient,
if !regionInfo.IsPreferred.IsUnknown() && !regionInfo.IsPreferred.IsNull() {
info.SetIsAffinitized(regionInfo.IsPreferred.Value)
}
if !regionInfo.IsDefault.IsUnknown() && !regionInfo.IsDefault.IsNull() {

if !regionInfo.IsDefault.IsUnknown() && !regionInfo.IsDefault.IsNull() && regionInfo.IsDefault.Value {
if isDefaultSet {
return nil, false, "Cluster must have exactly one default region."
}
info.SetIsDefault(regionInfo.IsDefault.Value)
isDefaultSet = true
}

clusterRegionInfo = append(clusterRegionInfo, info)
}

Expand Down

0 comments on commit 4f4f816

Please sign in to comment.