Merge pull request #59249 from hanxiaoshuai/fixtodo0202
Automatic merge from submit-queue. 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>. fix todo: Move isDecremented to pkg/apis/core/validation **What this PR does / why we need it**: fix todo: Move isDecremented in "k8s.io/kubernetes/pkg/apis/core/validation" **Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*: Fixes # **Special notes for your reviewer**: 2. If no release note is required, just write "NONE". --> ```release-note NONE ```
This commit is contained in:
@@ -4966,3 +4966,13 @@ func ValidateCIDR(cidr string) (*net.IPNet, error) {
|
||||
}
|
||||
return net, nil
|
||||
}
|
||||
|
||||
func IsDecremented(update, old *int32) bool {
|
||||
if update == nil && old != nil {
|
||||
return true
|
||||
}
|
||||
if update == nil || old == nil {
|
||||
return false
|
||||
}
|
||||
return *update < *old
|
||||
}
|
||||
|
Reference in New Issue
Block a user