Closed subnetmarco closed 2 years ago
The mock support is not a full api server nor kubernetes platform, so entries that look like Pods are not created for a Deployment. You'd have your test logic add them via crud operations or a KubernetesServer expectation.
@shawkins thanks for the pointers. Do you know where I can find a pragmatic example for using a KubernetesServer
expectation to change the status of a deployment over time in the test?
Could you please try something like this? In mocking watch during expectations mode, try sending a WatchEvent with Deployment status field updated to match ready fields https://github.com/fabric8io/kubernetes-client/blob/15ba0dd6c7e452c8f53905f23e3c22d35e9b1d9b/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/ResourceTest.java#L254-L258
This issue has been automatically marked as stale because it has not had any activity since 90 days. It will be closed if no further activity occurs within 7 days. Thank you for your contributions!
Is your enhancement related to a problem? Please describe
I am testing the creation of a new
Deployment
in a test with@EnableKubernetesMockClient(crud = true)
. I can successfully create theDeployment
and - in my test - watch that indeed it has been created:What I am struggling with right now, is to close the loop and properly test that the
Deployment
is indeed running with the right amount of replicas (using the mock server), and I cannot seem to find any indication on how to do that. Any tips?Describe the solution you'd like
Instructions - or an example - to properly test that the
Deployment
is running with the proper amount of replicas.Describe alternatives you've considered
No response
Additional context
No response