kubernetes/pkg/registry/core/service
Patrick Ohly 163211ee45 apiserver: pass context with ReqInfo to AllowUnconditionalUpdate and AllowCreateOnUpdate
This enables implementing different behavior for AllowUnconditionalUpdate and
AllowCreateOnUpdate depending on the API version, which can be found in
ReqInfo.APIVersion. The specific need for this is to switch from
AllowUnconditionalUpdate=true (not recommended!) to false in v1 of
resource.k8s.io DeviceTaintRule.

This is done by adding the missing context parameter to the existing methods
instead of adding a new optional interface because a) the resulting
implementation is simpler and gets checked by the compiler and b) the Go API
guarantees of k8s.io/apiserver are more relaxed than in other modules because
it's less used downstream.

Example implementation:

    func (*deviceTaintRuleStrategy) AllowUnconditionalUpdate(ctx context.Context) bool {
           reqInfo, _ := request.RequestInfoFrom(ctx)
           if reqInfo != nil && reqInfo.APIVersion == "v1" {
                   // Should have done that already earlier. Better late than never...
                   return false
           }
           // Historic behavior for v1beta2 and older, cannot change that anymore.
           return true
    }
2026-05-05 12:48:19 +02:00
..
allocator Enforce that all resources set resourcePrefix 2025-09-04 00:11:15 +02:00
ipallocator Update repairip_test.go 2026-02-20 15:56:07 -08:00
portallocator Remove redundant re-assignment in for-loops under pkg 2026-03-02 08:47:43 +01:00
storage fix flake on ipaddress allocator integration test 2026-02-10 10:34:47 +00:00
doc.go remove import doc comments 2024-12-02 16:59:34 +01:00
OWNERS add aojea as approver for networking APIs: services/allocators, networking group, ... 2023-01-29 00:10:06 +00:00
proxy.go Remove GetSingularName for subresources 2022-11-18 12:21:19 +03:00
strategy.go apiserver: pass context with ReqInfo to AllowUnconditionalUpdate and AllowCreateOnUpdate 2026-05-05 12:48:19 +02:00
strategy_test.go Remove LoadBalancerIPMode feature gate 2025-10-24 09:12:03 -04:00