Race between seeing a CRD added event and being able to select the kind #125471
Labels
kind/bug
Categorizes issue or PR as related to a bug.
needs-triage
Indicates an issue or PR lacks a `triage/foo` label and requires one.
sig/api-machinery
Categorizes an issue or PR as relevant to SIG API Machinery.
What happened?
We have observed a situation that looks to be a race condition whereby we have a watch on
CustomResourceDefinitions
and when we see anadded
event for a new one, we perform a list on theapiVersion
+kind
. When this runs on a pod however we get a 404 when performing the list operation unless we add an arbitrary delay.The context behind this is that we use this as a check to make sure a kind exists before performing other actions, such as creating a watch. We do not expect any resources to be present immediately after adding a CRD.
What did you expect to happen?
We would expect that we would not see an added event for a custom resource before the API server is able to serve the resource.
How can we reproduce it (as minimally and precisely as possible)?
It's hard as it's a bit racey, this is only reproducible from a pod and even then, not always.
CustomResourceDefinitions
ADDED
event is seen it will perform a get for the kind e.g.GET: /apis/GROUP/VERSION/KIND
If the event is received fast enough, the handler will see a 404 for it's GET call.
Anything else we need to know?
We are running a single master, so there is only one
etcd
Kubernetes version
Cloud provider
OS version
No response
Install tools
No response
Container runtime (CRI) and version (if applicable)
No response
Related plugins (CNI, CSI, ...) and versions (if applicable)
No response
The text was updated successfully, but these errors were encountered: