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

Ability to extend functionality of existing matchers like SSABasedGenericKubernetesResourceMatcher #2553

Open
murillio4 opened this issue Oct 15, 2024 · 1 comment
Milestone

Comments

@murillio4
Copy link

Is your feature request related to a problem? Please describe.
While addressing the issue discussed in #2509 regarding matching Quantity values, I created a custom matcher to extend the functionality of SSABasedGenericKubernetesResourceMatcher. My goal was to build upon the original matcher, preserving much of its existing functionality. However, when I attempted to override the matches function, I found that the other necessary methods were private, preventing me from utilizing them in my override. This forced me to clone the entire class to achieve the desired functionality.

Describe the solution you'd like
I would like to be able to create custom SSABased matchers by extending SSABasedGenericKubernetesResourceMatcher without needing to clone it entirely.

Describe alternatives you've considered
One alternative is to make certain helper methods—such as checkIfFieldManagerExists, sanitizeState, keepOnlyManagedFields, and removeIrrelevantValues—protected instead of private. Doing this may also require that some constants be readable at the subclass level, allowing for greater flexibility and customization when extending the base class.

@csviri csviri added this to the 5.1 milestone Oct 15, 2024
@csviri
Copy link
Collaborator

csviri commented Oct 15, 2024

Absolutely, feel free to come up with a PR, we can have a default set also of such rules. Would be nice to make it extensible maybe to have custom functions that normalises the resources.

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

No branches or pull requests

2 participants