-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
KubernetesMockServer Kubernetes client customization #5349
KubernetesMockServer Kubernetes client customization #5349
Conversation
More completely addresses fabric8io#5293
This suite tests exactly the same as `KubernetesMockServerExtensionClientAndServerStaticTests` Signed-off-by: Marc Nuri <[email protected]>
Signed-off-by: Marc Nuri <[email protected]>
…ustomization Signed-off-by: Marc Nuri <[email protected]>
80d09be
to
396edbc
Compare
The NamespaceExtension arguably has the same issue. Also let's just remove the OpenShiftMockServer rather than update it. |
Agreed to both. However, I'd rather tackle those separately (One new issue for each). |
Let's give a little thought to the NamespaceExtension before proceeding. Is your plan to similarly change the annotation and add another interface or base class to replace KubernetesMockClientKubernetesClientBuilder? It might be nice to have them be the same to more easily switch from a crud mock to a kubernetestest - maybe provide the whole Config or ConfigBuilder rather than just the url string to the customizer. Also https://github.com/fabric8io/kubernetes-client/pull/5349/files#diff-9ef31fbfb8fbafe18e5f18f5daa44de9705f3850a2e086aed2d123030a9448deR128 will need some documentation - if someone is using the mockserver manually (not through the annotation), then usage of this method is non-obvious as they likely need to extend KubernetesMockClientKubernetesClientBuilder |
I'm not convinced either about the String parameter. Sounds reasonable. |
should address the expressed concerns |
It seems like the customizer could just be Consumer - that would work for both the mock server and kubernetestest. Customizing the Config could be done seperately - you could either also provide a plugable Consumer or like other builders the KubernetesClientBuilder could directly provide an editConfig method. |
I'm not really following why the current approach won't work for the In NamespaceExtension we would do something in the lines of Maybe better to have a quick sync. |
As agreed in internal meeting, let's defer the Config overriding/editing to a follow-up. Tasks:
|
3d178e6
to
74dcb05
Compare
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.
LGTM, thanks for pushing to wire this into the annotation.
Signed-off-by: Marc Nuri <[email protected]>
74dcb05
to
2e1b8d1
Compare
Kudos, SonarCloud Quality Gate passed! |
Much appreciated, will keep an eye out for the release. |
Thanks for the release! |
Description
Supersedes closes #5347
Fixes #5293
Built on top of #5347 to provide a user-friendlier approach to customize the
KubernetesClientBuilder
instance used by theKubernetesMockServer
and theKubernetesMockServerExtension
.The easiest way to leverage the new functionality is by using the enhanced
@EnableKubernetesMockClient
where you can now pass a reference to a class implementingConsumer<KubernetesClientBuilder>
to customize the originalKubernetesClientBuilder
provided by theKubernetesMockServerExtension
.The following code snippet is an example of such use case:
/cc @jonsie
Type of change
test, version modification, documentation, etc.)
Checklist