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:
Kubernetes Submit Queue
2018-02-07 19:35:15 -08:00
committed by GitHub
2 changed files with 12 additions and 13 deletions

View File

@@ -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
}