Skip to content

Commit 851d7af

Browse files
Recreate deployment should always run the acceptor
Even in surge
1 parent 3b78e54 commit 851d7af

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

pkg/deploy/strategy/recreate/recreate.go

+9
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,8 @@ func (s *RecreateDeploymentStrategy) DeployWithAcceptor(from *kapi.ReplicationCo
142142
return strat.NewConditionReachedErr("mid hook succeeded")
143143
}
144144

145+
accepted := false
146+
145147
// Scale up the to deployment.
146148
if desiredReplicas > 0 {
147149
if from != nil {
@@ -155,6 +157,7 @@ func (s *RecreateDeploymentStrategy) DeployWithAcceptor(from *kapi.ReplicationCo
155157
if err := updateAcceptor.Accept(updatedTo); err != nil {
156158
return fmt.Errorf("update acceptor rejected %s: %v", to.Name, err)
157159
}
160+
accepted = true
158161
to = updatedTo
159162

160163
if strat.PercentageBetween(s.until, 1, 99) {
@@ -171,6 +174,12 @@ func (s *RecreateDeploymentStrategy) DeployWithAcceptor(from *kapi.ReplicationCo
171174
}
172175
to = updatedTo
173176
}
177+
178+
if !accepted {
179+
if err := updateAcceptor.Accept(to); err != nil {
180+
return fmt.Errorf("update acceptor rejected %s: %v", to.Name, err)
181+
}
182+
}
174183
}
175184

176185
if (from == nil && strat.PercentageBetween(s.until, 1, 100)) || (from != nil && s.until == "100%") {

0 commit comments

Comments
 (0)