controller: resolve unavailable in conjuction with surge for deployments
Due to rounding down for maxUnavailable, we may end up with deployments that have zero surge and unavailable pods something that 1) is not allowed as per validation, 2) blocks deployments. If we end up in such a situation set maxUnavailable to 1 on the theory that surge might not work due to quota.
This commit is contained in:
@@ -230,13 +230,14 @@ func TestDeploymentController_reconcileOldReplicaSets(t *testing.T) {
|
||||
expectedOldReplicas int
|
||||
}{
|
||||
{
|
||||
deploymentReplicas: 10,
|
||||
maxUnavailable: intstr.FromInt(0),
|
||||
oldReplicas: 10,
|
||||
newReplicas: 0,
|
||||
readyPodsFromOldRS: 10,
|
||||
readyPodsFromNewRS: 0,
|
||||
scaleExpected: false,
|
||||
deploymentReplicas: 10,
|
||||
maxUnavailable: intstr.FromInt(0),
|
||||
oldReplicas: 10,
|
||||
newReplicas: 0,
|
||||
readyPodsFromOldRS: 10,
|
||||
readyPodsFromNewRS: 0,
|
||||
scaleExpected: true,
|
||||
expectedOldReplicas: 9,
|
||||
},
|
||||
{
|
||||
deploymentReplicas: 10,
|
||||
@@ -492,11 +493,12 @@ func TestDeploymentController_scaleDownOldReplicaSetsForRollingUpdate(t *testing
|
||||
expectedOldReplicas int
|
||||
}{
|
||||
{
|
||||
deploymentReplicas: 10,
|
||||
maxUnavailable: intstr.FromInt(0),
|
||||
readyPods: 10,
|
||||
oldReplicas: 10,
|
||||
scaleExpected: false,
|
||||
deploymentReplicas: 10,
|
||||
maxUnavailable: intstr.FromInt(0),
|
||||
readyPods: 10,
|
||||
oldReplicas: 10,
|
||||
scaleExpected: true,
|
||||
expectedOldReplicas: 9,
|
||||
},
|
||||
{
|
||||
deploymentReplicas: 10,
|
||||
|
Reference in New Issue
Block a user