Skip to content

Commit

Permalink
Merge pull request #662 from perfectsense/bugfix/sort-availability-zo…
Browse files Browse the repository at this point in the history
…nes-for-db-cluster

Sort availability zones for db cluster
  • Loading branch information
harjain99 authored Oct 1, 2024
2 parents 1cdc8e0 + 981af9d commit 531412e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/main/java/gyro/aws/rds/DbClusterResource.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
package gyro.aws.rds;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.Set;
Expand Down Expand Up @@ -176,8 +177,9 @@ public void setApplyImmediately(Boolean applyImmediately) {
public List<String> getAvailabilityZones() {
if (availabilityZones == null) {
availabilityZones = new ArrayList<>();
} else {
Collections.sort(availabilityZones);
}

return availabilityZones;
}

Expand Down Expand Up @@ -710,7 +712,8 @@ public void setReaderEndpointAddress(String readerEndpointAddress) {

@Override
public void copyFrom(DBCluster cluster) {
setAvailabilityZones(cluster.availabilityZones());
setAvailabilityZones(new ArrayList<>(cluster.availabilityZones()));

setBackTrackWindow(cluster.backtrackWindow());
setBackupRetentionPeriod(cluster.backupRetentionPeriod());
setCharacterSetName(cluster.characterSetName());
Expand Down

0 comments on commit 531412e

Please sign in to comment.