@@ -163,22 +163,24 @@ func (c *rolloutContext) reconcileBlueGreenPause(activeSvc, previewSvc *corev1.S
163
163
return
164
164
}
165
165
pauseCond := getPauseCondition (c .rollout , v1alpha1 .PauseReasonBlueGreenPause )
166
- if pauseCond == nil && ! c .rollout .Status .ControllerPause {
167
- if pauseCond == nil {
168
- c .log .Info ("pausing" )
169
- }
170
- c .pauseContext .AddPauseCondition (v1alpha1 .PauseReasonBlueGreenPause )
171
- return
172
- }
173
-
174
- if ! c .pauseContext .CompletedBlueGreenPause () {
175
- c .log .Info ("pause incomplete" )
176
- if c .rollout .Spec .Strategy .BlueGreen .AutoPromotionSeconds > 0 {
177
- c .checkEnqueueRolloutDuringWait (pauseCond .StartTime , c .rollout .Spec .Strategy .BlueGreen .AutoPromotionSeconds )
166
+ if pauseCond != nil {
167
+ // We are currently paused. Check if we completed our pause duration
168
+ if ! c .pauseContext .CompletedBlueGreenPause () {
169
+ c .log .Info ("pause incomplete" )
170
+ if c .rollout .Spec .Strategy .BlueGreen .AutoPromotionSeconds > 0 {
171
+ c .checkEnqueueRolloutDuringWait (pauseCond .StartTime , c .rollout .Spec .Strategy .BlueGreen .AutoPromotionSeconds )
172
+ }
173
+ } else {
174
+ c .log .Infof ("pause completed" )
175
+ c .pauseContext .RemovePauseCondition (v1alpha1 .PauseReasonBlueGreenPause )
178
176
}
179
177
} else {
180
- c .log .Infof ("pause completed" )
181
- c .pauseContext .RemovePauseCondition (v1alpha1 .PauseReasonBlueGreenPause )
178
+ // no pause condition exists. If Status.ControllerPause is true, the user manually resumed
179
+ // the rollout. e.g. `kubectl argo rollouts promote ROLLOUT`
180
+ if ! c .rollout .Status .ControllerPause {
181
+ c .log .Info ("pausing" )
182
+ c .pauseContext .AddPauseCondition (v1alpha1 .PauseReasonBlueGreenPause )
183
+ }
182
184
}
183
185
}
184
186
0 commit comments