Merge pull request #43465 from kargakis/update-validation
Automatic merge from submit-queue Disable readyReplicas validation for Deployments Because there is no field in 1.5, when we update to 1.6 and the controller tries to update the Deployment, it will be denied by validation because the pre-existing availableReplicas field is greater than readyReplicas (normally readyReplicas should always be greater or equal). Fixes https://github.com/kubernetes/kubernetes/issues/43392 @kubernetes/sig-apps-bugs
This commit is contained in:
@@ -353,7 +353,9 @@ func ValidateDeploymentStatus(status *extensions.DeploymentStatus, fldPath *fiel
|
||||
if status.AvailableReplicas > status.Replicas {
|
||||
allErrs = append(allErrs, field.Invalid(fldPath.Child("availableReplicas"), status.AvailableReplicas, msg))
|
||||
}
|
||||
if status.AvailableReplicas > status.ReadyReplicas {
|
||||
// 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 {
|
||||
allErrs = append(allErrs, field.Invalid(fldPath.Child("availableReplicas"), status.AvailableReplicas, "cannot be greater than readyReplicas"))
|
||||
}
|
||||
return allErrs
|
||||
|
Reference in New Issue
Block a user