apiserver/pkg/server
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
..
dynamiccertificates fsnotify: use event.Has instead of "event.Op&h == h" 2022-10-13 13:42:11 +08:00
egressselector egress_selector.go: register konnectivity-client metrics. 2023-01-04 18:38:22 +00:00
filters apiserver: refactor WithWaitGroup handler 2023-01-10 15:55:19 -05:00
healthz Bump log level for health check warning for missing components 2022-10-17 09:42:09 -04:00
httplog Added simple tests and changed lazyVerb String method to the same as httplog uses 2022-11-07 17:13:26 +00:00
mux Check in OWNERS modified by update-yamlfmt.sh 2021-12-09 21:31:26 -05:00
options wait: Use a context implementation for ContextForChannel 2023-01-17 15:01:02 -05:00
resourceconfig reduce API surface area of whether a resource is enabled 2022-02-21 17:23:19 -05:00
routes Allow profiling information to be served on Unix-Domain Socket 2022-11-29 11:07:15 -08:00
storage kube-apiserver: print supported media types on failure to find a serializer 2022-11-05 23:03:23 +08:00
config.go apiserver: use the identity value in the apiserver identity hash 2023-01-13 15:49:30 -05:00
config_selfclient.go Move the comment to the right line 2021-04-23 00:05:15 +00:00
config_selfclient_test.go run hack/update-netparse-cve.sh 2021-08-20 01:16:14 +02:00
config_test.go apiserver: refactor WithWaitGroup handler 2023-01-10 15:55:19 -05:00
deleted_kinds.go Switch deprecated API serving back to gating on beta 2022-11-15 22:02:49 -05:00
deleted_kinds_test.go Implement Destroy() method for all registries 2022-04-05 12:26:22 +02:00
deprecated_insecure_serving.go Set idle and readheader timeouts 2021-07-27 11:58:45 -04:00
doc.go update docs.go files under staging/src/k8s.io/apiserver/pkg/server 2019-02-03 20:43:13 +00:00
genericapiserver.go apiserver: refactor WithWaitGroup handler 2023-01-10 15:55:19 -05:00
genericapiserver_graceful_termination_test.go apiserver: refactor WithWaitGroup handler 2023-01-10 15:55:19 -05:00
genericapiserver_test.go apiserver: refactor WithWaitGroup handler 2023-01-10 15:55:19 -05:00
graceful_shutdown_test.go adds a unit test for checking if graceful shutdown of HTTP2 server works 2020-12-11 13:12:46 +01:00
handler.go Generate and format files 2022-07-19 20:54:13 -04:00
healthz.go Migrate to k8s.io/utils/clock in apiserver 2021-09-14 20:36:07 +02:00
healthz_test.go Migrate to k8s.io/utils/clock in apiserver 2021-09-14 20:36:07 +02:00
hooks.go Generate and format files 2022-07-19 20:54:13 -04:00
lifecycle_signals.go Generate and format files 2022-07-19 20:54:13 -04:00
plugins.go Rename admission cel package to validatingadmissionpolicy 2022-11-08 14:18:26 +00:00
secure_serving.go API Server Changes 2022-03-07 09:20:45 -05:00
signal.go make Kubelet bootstrap certificate signal aware 2020-07-04 12:08:04 +08:00
signal_posix.go generated: Run hack/update-gofmt.sh 2021-08-12 17:13:11 -04:00
signal_windows.go apiservers: add synchronous shutdown mechanism on SIGTERM+INT 2017-08-29 13:16:11 +00:00