apiserver/pkg
Clayton Coleman 03e6089ce8 wait: Use a context implementation for ContextForChannel
ContextForChannel uses a goroutine to transform a channel close to
a context cancel. However, this exposes a synchronization issue if
we want to unify the underlying implementation between contextless
and with context - a ConditionFunc that closes the channel today
expects the behavior that no subsequent conditions will be invoked
(we have a test in wait_test.go TestUntilReturnsImmediately that
verifies this expectation). We can't unify the implementation
without ensuring this property holds.

To do that this commit changes from the goroutine propagation to
implementing context.Context and using stopCh as the Done(). We
then implement Err() by returning context.Canceled and stub the
other methods. Since our context cannot be explicitly cancelled
by users, we cease to return the cancelFn and callers that need
that behavior must wrap the context as normal.

This should be invisible to clients - they would already observe
the same behavior from the context, and the existing error
behavior of Poll* is preserved (which ignores ctx.Err()).

As a side effect, one less goroutine is created making it more
efficient.

Kubernetes-commit: 95051a63b323081daf8a3fe55a252eb79f0053aa
2023-01-17 15:01:02 -05:00
..
admission fix bug with param controllers being removed if used by more than one policy 2023-01-17 15:27:45 -08:00
apis Update the godoc on the encryption config API on how to specify group/resources to be encrypted 2022-11-28 07:18:02 -08:00
audit Combine RequestAuditConfig with RequestAuditConfigWithLevel 2022-11-02 15:23:48 -07:00
authentication actually resolve the computations for buckets for static analysis 2022-10-13 13:44:51 -07:00
authorization Check in OWNERS modified by update-yamlfmt.sh 2021-12-09 21:31:26 -05:00
cel add help for cel metrics 2022-12-09 04:53:02 +00:00
endpoints cleanup: EphemeralContainers feature gate related codes 2022-12-16 23:46:47 +08:00
features the AdvancedAuditing featuregate has been GA since v1.12, and is locked to ture in v1.27 2023-01-18 18:50:15 +08:00
quota/v1 go1.19: change some atomic.Value to atomic.Bool 2022-09-06 17:13:44 +08:00
registry Add singular name for the rest of types 2022-11-03 10:18:45 +03:00
server wait: Use a context implementation for ContextForChannel 2023-01-17 15:01:02 -05:00
storage apiserver/kmsv2: mv Service interface into kmsv2 2023-01-09 14:36:06 +01:00
storageversion go1.19: change some atomic.Value to atomic.Bool 2022-09-06 17:13:44 +08:00
util Prune trailing newlines when enums are disabled 2023-01-06 00:58:23 -05:00
warning track legacy service account tokens 2022-03-21 14:21:41 -07:00