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

Convert per-resource registries to all-resource registries #622

Merged
merged 3 commits into from
Dec 20, 2020

Conversation

nolar
Copy link
Owner

@nolar nolar commented Dec 20, 2020

As a preparatory refactoring, the per-resource registries cease to exist and are replaced by all-resource registries. The matching now additionally include resource matching — in addition to labels, annotations, callbacks, and other filters.

The final goal is that the resources are split into resource selectors (criteria) & actual resources (specifics) so that one spec could match multiple refs — within one and only one handler. In this context, such "all-resource" structure of registries becomes unavoidable.

[SEMI-BREAKING] The old way of accessing the registries by resources-as-keys is supported for backward compatibility, but it returns the whole all-resource registry itself, which may contain handlers unrelated to the requested resource — proper methods should be used instead, which check for resource spec. If this is not done, handlers for unrelated resources can be exposed. Nevertheless, this edge-case breakage is acceptable: registries were exposed by mistake (they are not the value that this framework delivers), and are already deprecated.

As a preparatory refactoring, the per-resource registries cease to exist and are replaced by all-resource registries. The matching now additionally include resource matching — in addition to labels, annotations, callbacks, and other filters.

The final goal is that the resources are split into resource selectors (criteria) & actual resources (specifics) so that one spec could match multiple refs — within one and only one handler. In this context, such "all-resource" structure of registries becomes unavoidable.

**[SEMI-BREAKING]** The old way of accessing the registries by resources-as-keys is supported for backward compatibility, but it returns the whole all-resource registry itself, which may contain handlers unrelated to the requested resource — proper methods should be used instead, which check for resource spec. If this is not done, handlers for unrelated resources can be exposed. Nevertheless, **this edge-case breakage is acceptable**: registries were exposed by mistake (they are not the value that this framework delivers), and are already deprecated.
@nolar nolar added the refactoring Code cleanup without new features added label Dec 20, 2020
@nolar nolar merged commit 31f5d09 into master Dec 20, 2020
@nolar nolar deleted the all-resource-registries branch December 20, 2020 18:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactoring Code cleanup without new features added
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant