Fix the possible negative scale down value; add logs when scaling down

This commit is contained in:
Janet Kuo
2016-03-10 15:06:38 -08:00
parent 7341b0a265
commit 4a181dacec
3 changed files with 26 additions and 9 deletions

View File

@@ -471,7 +471,7 @@ func TestDeploymentController_cleanupUnhealthyReplicas(t *testing.T) {
client: &fakeClientset,
eventRecorder: &record.FakeRecorder{},
}
cleanupCount, err := controller.cleanupUnhealthyReplicas(oldRSs, &deployment, test.maxCleanupCount)
_, cleanupCount, err := controller.cleanupUnhealthyReplicas(oldRSs, &deployment, test.maxCleanupCount)
if err != nil {
t.Errorf("unexpected error: %v", err)
continue
@@ -522,6 +522,13 @@ func TestDeploymentController_scaleDownOldReplicaSetsForRollingUpdate(t *testing
oldReplicas: 0,
scaleExpected: false,
},
{
deploymentReplicas: 10,
maxUnavailable: intstr.FromInt(2),
readyPods: 1,
oldReplicas: 10,
scaleExpected: false,
},
}
for i, test := range tests {