mirror of https://github.com/k3s-io/k3s
Merge pull request #55321 from xiangpengzhao/remove-1.5thing
Automatic merge from submit-queue (batch tested with PRs 53780, 55663, 55321, 52421, 55659). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. Remove the comparison of ReadyReplicas to zero. **What this PR does / why we need it**: **Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*: ref: #43465 **Special notes for your reviewer**: AFAIK, we have already stopped supporting upgrades from 1.5. cc @fejta @krzyzacy **Release note**: ```release-note NONE ```pull/6/head
commit
b96c1dc560
|
@ -325,9 +325,7 @@ func ValidateDeploymentStatus(status *extensions.DeploymentStatus, fldPath *fiel
|
||||||
if status.AvailableReplicas > status.Replicas {
|
if status.AvailableReplicas > status.Replicas {
|
||||||
allErrs = append(allErrs, field.Invalid(fldPath.Child("availableReplicas"), status.AvailableReplicas, msg))
|
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.
|
if status.AvailableReplicas > status.ReadyReplicas {
|
||||||
// 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"))
|
allErrs = append(allErrs, field.Invalid(fldPath.Child("availableReplicas"), status.AvailableReplicas, "cannot be greater than readyReplicas"))
|
||||||
}
|
}
|
||||||
return allErrs
|
return allErrs
|
||||||
|
|
|
@ -1335,15 +1335,6 @@ func TestValidateDeploymentStatus(t *testing.T) {
|
||||||
observedGeneration: 1,
|
observedGeneration: 1,
|
||||||
expectedErr: true,
|
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",
|
name: "invalid collisionCount",
|
||||||
replicas: 3,
|
replicas: 3,
|
||||||
|
|
Loading…
Reference in New Issue