Skip to content

Commit

Permalink
Fix DC latestVersion validation
Browse files Browse the repository at this point in the history
  • Loading branch information
tnozicka committed Mar 15, 2019
1 parent e6c45b8 commit c5f5180
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions pkg/apps/apis/apps/validation/validation.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,6 @@ func ValidateDeploymentConfigStatusUpdate(newConfig *appsapi.DeploymentConfig, o
statusPath := field.NewPath("status")
if newConfig.Status.LatestVersion < oldConfig.Status.LatestVersion {
allErrs = append(allErrs, field.Invalid(statusPath.Child("latestVersion"), newConfig.Status.LatestVersion, "latestVersion cannot be decremented"))
} else if newConfig.Status.LatestVersion > (oldConfig.Status.LatestVersion + 1) {
allErrs = append(allErrs, field.Invalid(statusPath.Child("latestVersion"), newConfig.Status.LatestVersion, "latestVersion can only be incremented by 1"))
}
if newConfig.Status.ObservedGeneration < oldConfig.Status.ObservedGeneration {
allErrs = append(allErrs, field.Invalid(statusPath.Child("observedGeneration"), newConfig.Status.ObservedGeneration, "observedGeneration cannot be decremented"))
Expand Down

0 comments on commit c5f5180

Please sign in to comment.