-
Notifications
You must be signed in to change notification settings - Fork 195
refactor(config)!: extract config interfaces to pkg/api/config #566
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
refactor(config)!: extract config interfaces to pkg/api/config #566
Conversation
d8451c1 to
aeb75d7
Compare
nader-ziada
left a comment
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.
I like the idea of creating the interfaces for other packages to use, so there is no dependency on pkg/config
added some small suggestions
Decouples the pkg/kubernetes module from pkg/config by introducing interfaces for configuration access. This allows pkg/kubernetes to depend on abstractions rather than the concrete StaticConfig type. Changes: - Add AuthProvider, ClusterProvider, DeniedResourcesProvider, and ExtendedProvider interfaces in pkg/api/config - Move cluster provider strategy constants to pkg/api/config - Move GroupVersionKind struct to pkg/api/config - Update pkg/kubernetes to use the new interfaces - StaticConfig now implements the Config interface Signed-off-by: Marc Nuri <[email protected]>
aeb75d7 to
522795c
Compare
|
thanks @manusa /lgtm |
|
@Cali0707 note that this will break downstream again :( |
there is already another breaking change from the drop-in reload PR that is not synced downstream yet |
|
Yep I will do another sync later, will aim to do one per week |
🙌 I'll try to get more involved in the process. I want to check before the end of the week to see if we can better reorganize upstream so that the syncing process could be streamlined even more. |
At the moment, the config and kubernetes modules are tightly coupled.
While reviewing the changes in #559, the current state proves to be a problem since workarounds are required to be able to easily unmarshal the configuration.
Ideally, configuration unmarshalling and parsing should be part of the
pkg/configpackage, while the api package should focus just on defining the structs and interfaces.This PR attempts to decouple kubernetes from the config module by providing config API interfaces.
kubernetes->api->config->...I'm not proud of how it looks like, but I think that it's a step in the right direction.
Suggestions for further improvements are welcome ;)
Decouples the pkg/kubernetes module from pkg/config by introducing interfaces for configuration access. This allows pkg/kubernetes to depend on abstractions rather than the concrete StaticConfig type.
Changes: