Skip to content

Commit 5f49664

Browse files
Added suggestions from PRR review
1 parent 1c4f43b commit 5f49664

File tree

1 file changed

+6
-8
lines changed
  • keps/sig-node/4818-allow-zero-value-for-sleep-action-of-prestop-hook

1 file changed

+6
-8
lines changed

keps/sig-node/4818-allow-zero-value-for-sleep-action-of-prestop-hook/README.md

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ The proposed change adds another layer to the `validateSleepAction` function to
211211
+ }
212212
+ } else {
213213
+ if gracePeriod != nil && sleep.Seconds <= 0 || sleep.Seconds > *gracePeriod {
214-
+ invalidStr := fmt.Sprintf("must be greater than 0 and less than terminationGracePeriodSeconds (%d)", *gracePeriod)
214+
+ invalidStr := fmt.Sprintf("must be greater than 0 and less than terminationGracePeriodSeconds (%d). Please enable PodLifecycleSleepActionAllowZero feature gate if you need a sleep of zero duration.", *gracePeriod)
215215
+ allErrors = append(allErrors, field.Invalid(fldPath, sleep.Seconds, invalidStr))
216216
+ }
217217
}
@@ -291,19 +291,18 @@ This can inform certain test coverage improvements that we want to do before
291291
extending the production code to implement this enhancement.
292292
-->
293293

294-
- `<package>`: `<date>` - `<test coverage>`
295-
296294
Alpha:
297295

298296
- Test that the runSleepHandler function returns immediately when given a duration of zero.
299297
- Test that the validation succeeds when given a zero duration with the feature gate enabled.
300298
- Test that the validation fails when given a zero duration with the feature gate disabled.
301299
- Test that the validation returns the appropriate error messages when given an invalid duration value (e.g., a negative value) with the feature gate disabled and enabled.
300+
- Unit tests for testing the disabling of the feature gate after it was enabled and the feature was used.
302301

303302
Current coverages:
304303

305-
- `k8s.io/kubernetes/pkg/apis/core/validation` : 2024-09-20 - 84.3
306-
- `k8s.io/kubernetes/pkg/kubelet/lifecycle/handlers` :2024-09-20 - 86.4
304+
- `k8s.io/kubernetes/pkg/apis/core/validation` : 2024-09-20 - 84.3
305+
- `k8s.io/kubernetes/pkg/kubelet/lifecycle/handlers` : 2024-09-20 - 86.4
307306

308307
##### Integration tests
309308

@@ -366,10 +365,9 @@ The previous PreStop Sleep Action behavior will not be broken. Users can continu
366365

367366
#### Downgrade
368367

369-
If the kube-apiserver is downgraded to a version where the feature gate is not supported (<v1.32), no new resources can be created with a PreStop sleep duration of zero seconds. Existing resources will continue to function, but they cannot be updated since the validation for the sleep duration would fail if the value is set to zero. Cluster admins can update their resources to have a non-zero value for the sleep duration and migrate their resources if they want to update it.
370-
371-
If the feature gate is turned off after being enabled, no new resources can be created with PreStop sleep duration of zero seconds. Existing resources will continue to function, but as discussed in the Proposal section, the sleep duration will need to be updated to a non-zero value if the resource has to be updated.
368+
If the kube-apiserver is downgraded to a version where the feature gate is not supported (<v1.32), no new resources can be created with a PreStop sleep duration of zero seconds. Existing resources created with a sleep duration of zero will continue to function.
372369

370+
If the feature gate is turned off after being enabled, no new resources can be created with PreStop sleep duration of zero seconds. Existing resources will continue to run and use a sleep duration of zero seconds. These resources can be updated and the zero sleep duration would continue to work.
373371

374372
### Version Skew Strategy
375373

0 commit comments

Comments
 (0)