Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove the comparison of ReadyReplicas to zero. #55321

Merged
merged 1 commit into from
Nov 15, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 1 addition & 3 deletions pkg/apis/extensions/validation/validation.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 0 additions & 9 deletions pkg/apis/extensions/validation/validation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1335,15 +1335,6 @@ func TestValidateDeploymentStatus(t *testing.T) {
observedGeneration: 1,
expectedErr: true,
},
// TODO: Remove the following test case once we stop supporting upgrades from 1.5.
{
name: "don't validate readyReplicas when it's zero",
replicas: 3,
readyReplicas: 0,
availableReplicas: 3,
observedGeneration: 1,
expectedErr: false,
},
{
name: "invalid collisionCount",
replicas: 3,
Expand Down