Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sort availability zones for db cluster #662

Merged
merged 5 commits into from
Oct 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading