Skip to content

Commit 006e008

Browse files
committed
fix: update strategy type only considered if annotation is also present
1 parent 7a56203 commit 006e008

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

stackgres-k8s/src/operator/src/main/java/io/stackgres/operator/common/ClusterRolloutUtil.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ public static boolean isRolloutAllowed(StackGresCluster cluster) {
7373
if (Objects.equals(
7474
annotations.get(StackGresContext.ROLLOUT_KEY),
7575
StackGresContext.ROLLOUT_ALWAYS_VALUE)
76-
|| (hasRolloutAnnotation && updateStrategyType == StackGresClusterUpdateStrategyType.ALWAYS)) {
76+
|| (!hasRolloutAnnotation && updateStrategyType == StackGresClusterUpdateStrategyType.ALWAYS)) {
7777
return true;
7878
}
7979
if (annotations.containsKey(StackGresContext.ROLLOUT_DBOPS_KEY)) {
@@ -83,7 +83,7 @@ public static boolean isRolloutAllowed(StackGresCluster cluster) {
8383
annotations.get(StackGresContext.ROLLOUT_KEY),
8484
StackGresContext.ROLLOUT_SCHEDULE_VALUE)
8585
&& annotations.containsKey(StackGresContext.ROLLOUT_SCHEDULE_KEY))
86-
|| (hasRolloutAnnotation && updateStrategyType == StackGresClusterUpdateStrategyType.SCHEDULE
86+
|| (!hasRolloutAnnotation && updateStrategyType == StackGresClusterUpdateStrategyType.SCHEDULE
8787
&& Optional.of(cluster)
8888
.map(StackGresCluster::getSpec)
8989
.map(StackGresClusterSpec::getPods)

0 commit comments

Comments
 (0)