-
Notifications
You must be signed in to change notification settings - Fork 40k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix a problem with multiple APIs clobbering each other in registration. #28431
Fix a problem with multiple APIs clobbering each other in registration. #28431
Conversation
Please add a test |
@polvi I don't follow your comment in the original issue: "there appears to be a race in kubectl for the ability to read the APIs". I think kubectl is single-threaded, why would there be a race? I think this PR is correct in that appending filteredGVs to thirdPartyGroupVersions, but I don't understand why @polvi observed on and off error in the original issue, I expect it to always fail. |
@caesarxuchao it's not actually a race. It's actually because of Golang's randomized map iteration "feature" (I think) So you load in two APIs on the same path, depending the randomness you iterate them in potentially different orders which makes different APIs found (or not). I will add a test. |
Right, the randomness comes from the map here: https://github.com/kubernetes/kubernetes/blob/master/pkg/kubectl/cmd/util/factory.go#L294 |
@lavalamp test added, ptal. Thanks |
LGTM. Thanks! |
@@ -70,6 +74,16 @@ func init() { | |||
} | |||
} | |||
|
|||
// Resets everything to clean room for the start of a test | |||
func clearForTesting() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ugh, this is awful, I really need to get my changes in so it's not necessary :(
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed, please reply here (e.g.
|
@brendandburns do you want to cherry pick this into the 1.3 branch? |
GCE e2e build/test passed for commit 891bd3e. |
I signed it! |
CLAs look good, thanks! |
@roberthbailey yeah, I'll prepare a cherry pick once this is in. |
@k8s-bot test this [submit-queue is verifying that this PR is safe to merge] |
GCE e2e build/test passed for commit 891bd3e. |
Automatic merge from submit-queue |
@brendandburns @pwittrock This is in v1.4 milestone, but with cherrypick tags. Is the intent still to get into 1.3.x at some point? |
We're close enough to 1.4 that we can probably wait. --brendan From: goltermann notifications@github.com @brendandburnshttps://github.com/brendandburns @pwittrockhttps://github.com/pwittrock This is in v1.4 milestone, but with cherrypick tags. Is the intent still to get into 1.3.x at some point? You are receiving this because you were mentioned. |
Removing cherrypick tags for now, as this change is already in the 1.4 branch. If the intent is to add it to the 1.3 milestone, please re-add them later. |
Fixes #24392
@kubernetes/sig-api-machinery
This change is