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

OSSM-2006 Fix HasSynced() [maistra-2.1] #22

Merged
merged 5 commits into from Sep 20, 2022

Conversation

luksa
Copy link
Contributor

@luksa luksa commented Sep 19, 2022

Previously, if the set of namespaces in the multiNamespaceInformer was empty, HasSynced() would return true. This caused controllers to start, even though there are no informers in multiNamespaceeInformer. The controllers would read from the cache (which would return no resources), causing them to perform the reconcile on bad input data. Typically, this would cause the controller to remove resources that shouldn't be removed. Of course, moments later, the namespace list gets initialized, the controllers are notified of the appearance of new resources, and they recreate the resources they had removed a moment ago. Although the end state is correct, for some resource types, such as Routes, their deletion wreaks havoc.

HasSynced() shouldn't return true until SetNamespaces() has been called at least once (this is done by the ServiceMeshMemberRoll controller after it reads the ServiceMeshMemberRoll object for the first time). The informer also shouldn't be initialized with all namespaces, but should remain empty until the actual member namespace list is read from the ServiceMeshMemberRoll.

Previously, if the set of namespaces in the multiNamespaceInformer was empty, HasSynced() would return true. This caused controllers to start, even though there are no informers in multiNamespaceeInformer. The controllers would read from the cache (which would return no resources), causing them to perform the reconcile on bad input data. Typically, this would cause the controller to remove resources that shouldn't be removed. Of course, moments later, the namespace list gets initialized, the controllers are notified of the appearance of new resources, and they recreate the resources they had removed a moment ago. Although the end state is correct, for some resource types, such as Routes, their deletion wreaks havoc.

HasSynced() shouldn't return true until SetNamespaces() has been called at least once (this is done by the ServiceMeshMemberRoll controller after it reads the ServiceMeshMemberRoll object for the first time). The informer also shouldn't be initialized with all namespaces, but should remain empty until the actual member namespace list is read from the ServiceMeshMemberRoll.
@maistra-bot maistra-bot merged commit f0b868f into maistra:maistra-2.1 Sep 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants