kubernetes/cmd
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
..
clicheck Update sig-cli OWNERS 2022-02-14 10:55:35 -07:00
cloud-controller-manager cloud-controller-manager: don't run cloud IPAM controller when cloud provider is not enabled 2022-12-20 10:29:02 -05:00
dependencycheck replace deprecated io/ioutil with os and io for cmd 2022-02-01 13:59:41 +08:00
dependencyverifier Fix unwanted dependencies scanner 2022-10-28 15:15:20 -04:00
gendocs Add cli-maintainers as approvers to cmd/(gendocs|genman|genyaml) 2022-03-28 14:00:35 +02:00
genkubedocs replace deprecated io/ioutil with os and io for cmd 2022-02-01 13:59:41 +08:00
genman Add cli-maintainers as approvers to cmd/(gendocs|genman|genyaml) 2022-03-28 14:00:35 +02:00
genswaggertypedocs hack/update-bazel.sh 2021-02-28 15:17:29 -08:00
genutils hack/update-bazel.sh 2021-02-28 15:17:29 -08:00
genyaml Add cli-maintainers as approvers to cmd/(gendocs|genman|genyaml) 2022-03-28 14:00:35 +02:00
importverifier replace deprecated io/ioutil with os and io for cmd 2022-02-01 13:59:41 +08:00
kube-apiserver cmd/kubeapiserver: Clean code, avoid unnecessary condition, avoid non-nil but zero-length slice 2023-01-06 18:03:41 +01:00
kube-controller-manager wait: Use a context implementation for ContextForChannel 2023-01-18 10:00:47 -05:00
kube-proxy Merge pull request #114773 from yangjunmyfm192085/fixsmallerrorlog 2023-01-11 07:51:43 -08:00
kube-scheduler optionally ignore preferred terms of existing pods unless incoming pod 2023-01-13 23:15:53 +00:00
kubeadm Revert "UpdateOrCreateToken get secrets err handling optimization" 2023-01-14 00:11:49 +02:00
kubectl Update sig-cli OWNERS 2022-02-14 10:55:35 -07:00
kubectl-convert Update sig-cli OWNERS 2022-02-14 10:55:35 -07:00
kubelet cpuset: Rename 'NewCPUSet' to 'New' 2023-01-06 23:32:51 +00:00
kubemark remove a flag check that was introduced in #112542; address several comments 2022-12-13 14:00:29 +08:00
preferredimports preferredimports: support regular expressions for the import path 2022-09-08 18:37:52 +02:00
prune-junit-xml Include head and tail of clipped test messages 2023-01-10 11:26:34 -05:00
yamlfmt Make yamlfmt tool print filenames 2022-07-13 20:33:40 -07:00
OWNERS Move root approvers to subdirs 2022-10-10 13:43:03 -04:00