kubernetes/cmd/kube-controller-manager/app
Clayton Coleman 95051a63b3
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.
2023-01-18 10:00:47 -05:00
..
config controller-manager: remove deprecated insecure serving from Config 2022-08-31 17:32:21 +08:00
options cmd/kube-controller-manager/app/options: Improving test coverage 2022-12-13 14:05:48 +01:00
testing Fix indentation/spacing in comments to render correctly in godoc 2022-12-17 23:27:38 -05:00
apps.go Generate and format files 2022-07-26 13:14:05 -04:00
autoscaling.go add --concurrent-horizontal-pod-autoscaler-syncs flag to kube-controller-manager 2022-10-17 17:39:31 +02:00
batch.go Generate and format files 2022-07-26 13:14:05 -04:00
bootstrap.go Wire contexts to Bootstrap controllers 2021-10-06 10:27:32 -04:00
certificates_test.go allow setting different certificates for kube-controller-managed CSR signers 2020-07-09 08:14:55 -04:00
certificates.go Generate and format files 2022-07-26 13:14:05 -04:00
cloudproviders.go Add DisableCloudProviders FG 2021-05-21 16:09:44 +02:00
controllermanager.go wait: Use a context implementation for ContextForChannel 2023-01-18 10:00:47 -05:00
core_test.go Remove Stop from ControllerContext and pass ctx.Done 2021-09-27 09:16:38 -04:00
core.go kube-controller-manager: don't run cloud IPAM controller when cloud provider is not enabled 2022-12-20 10:29:02 -05:00
discovery.go Generate and format files 2022-07-26 13:14:05 -04:00
flags_providerless.go generated: Run hack/update-gofmt.sh 2021-08-24 15:47:49 -04:00
flags_providers.go generated: Run hack/update-gofmt.sh 2021-08-24 15:47:49 -04:00
import_known_versions.go kube-controller-manager: add ResourceClaim controller 2022-11-10 20:23:50 +01:00
plugins_providerless.go generated: Run hack/update-gofmt.sh 2021-08-24 15:47:49 -04:00
plugins_providers.go Remove references to openstack and cinder 2022-08-22 16:43:14 -04:00
plugins.go removal of glusterfs in-tree driver code from the source 2022-09-13 20:11:50 +05:30
policy.go Generate and format files 2022-07-26 13:14:05 -04:00
rbac.go Wire contexts to RBAC controllers 2021-10-07 15:04:49 -04:00