mirror of
https://github.com/kubernetes/kubernetes.git
synced 2026-03-06 07:30:42 -05:00
Automatic merge from submit-queue
deployment: SetNewReplicaSetAnnotations() should compare revisions as numbers than strings
**What this PR does / why we need it**:
1) SetNewReplicaSetAnnotations() when deployment revision annotation is copied over to RS, it performs a string comparison instead of int comparison, due to this any revision beyond 9 might not get copied.
2) Slightly improves the coverage by adding UT for Annotation related functions
3) Upgrade the test suite to use go-langs sub-test, which is very useful while investigating UT related failures.
```
--- FAIL: TestAnnotationUtils (0.00s)
--- FAIL: TestAnnotationUtils/SetNewReplicaSetAnnotations (0.00s)
deployment_util_test.go:1283: Revision Expected=10 Obtained=9
deployment_util_test.go:1283: Revision Expected=11 Obtained=9
deployment_util_test.go:1283: Revision Expected=12 Obtained=9
deployment_util_test.go:1283: Revision Expected=13 Obtained=9
deployment_util_test.go:1283: Revision Expected=14 Obtained=9
deployment_util_test.go:1283: Revision Expected=15 Obtained=9
deployment_util_test.go:1283: Revision Expected=16 Obtained=9
deployment_util_test.go:1283: Revision Expected=17 Obtained=9
deployment_util_test.go:1283: Revision Expected=18 Obtained=9
deployment_util_test.go:1283: Revision Expected=19 Obtained=9
deployment_util_test.go:1283: Revision Expected=20 Obtained=9
--- PASS: TestAnnotationUtils/SetReplicasAnnotations (0.00s)
--- PASS: TestAnnotationUtils/IsSaturated (0.00s)
```
**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #
**Special notes for your reviewer**:
**Release note**: None
```release-note
```
cc: @kargakis
|
||
|---|---|---|
| .. | ||
| bootstrap | ||
| certificates | ||
| cloud | ||
| cronjob | ||
| daemon | ||
| deployment | ||
| disruption | ||
| endpoint | ||
| garbagecollector | ||
| history | ||
| job | ||
| namespace | ||
| node | ||
| podautoscaler | ||
| podgc | ||
| replicaset | ||
| replication | ||
| resourcequota | ||
| route | ||
| service | ||
| serviceaccount | ||
| statefulset | ||
| ttl | ||
| volume | ||
| .import-restrictions | ||
| BUILD | ||
| client_builder.go | ||
| controller_ref_manager.go | ||
| controller_ref_manager_test.go | ||
| controller_utils.go | ||
| controller_utils_test.go | ||
| doc.go | ||
| lookup_cache.go | ||
| OWNERS | ||