Skip to content
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

Use original crd if already exists #309

Merged
merged 1 commit into from
Dec 9, 2019

Conversation

nanorobocop
Copy link
Contributor

This PR fixes concurrent CRD creation.
Multiple Rancher replicas concurrently create CRDs. According to implementation, empty CRD struct will be used if CRD already exists, which cause Rancher panic (but succeed on next pod restart when all CRDs already created).

Empty structure generated in https://github.com/kubernetes/apiextensions-apiserver/blob/master/pkg/client/clientset/clientset/typed/apiextensions/v1beta1/customresourcedefinition.go#L108
Original CRD struct should be used if AlreadyExists https://github.com/rancher/norman/blob/master/store/crd/init.go#L199
Panic happens here https://github.com/rancher/norman/blob/master/store/crd/init.go#L65 because of usage of empty CRD structure with uninitialized fields (crd.Name)

It doesn't break the whole deployment, but increase deployment time because of Rancher restart.

@ibuildthecloud ibuildthecloud merged commit 5b9227f into rancher:master Dec 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants