Remove the comparison of ReadyReplicas to zero.

This commit is contained in:
xiangpengzhao
2017-11-08 22:51:41 +08:00
parent 33f873dbbe
commit 3eada458d7
2 changed files with 1 additions and 12 deletions

View File

@@ -325,9 +325,7 @@ func ValidateDeploymentStatus(status *extensions.DeploymentStatus, fldPath *fiel
if status.AvailableReplicas > status.Replicas {
allErrs = append(allErrs, field.Invalid(fldPath.Child("availableReplicas"), status.AvailableReplicas, msg))
}
// TODO: ReadyReplicas is introduced in 1.6 and this check breaks the Deployment controller when pre-1.6 clusters get upgraded.
// Remove the comparison to zero once we stop supporting upgrades from 1.5.
if status.ReadyReplicas > 0 && status.AvailableReplicas > status.ReadyReplicas {
if status.AvailableReplicas > status.ReadyReplicas {
allErrs = append(allErrs, field.Invalid(fldPath.Child("availableReplicas"), status.AvailableReplicas, "cannot be greater than readyReplicas"))
}
return allErrs