feature: add kubernetes api_client parameter to kubetest client #144
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR:
api_client
parameter to pass to the Kubernetes client.api_client
Caveats:
In order for the test client (e.g. returned by the
kube
fixture) to use a custom api_client, the test author must manually set it at the top of the test, e.g.Interactions through the
kube
client will have access to the custom client and will use it if set, however if any of the kubetest object wrappers (e.g.kubetest.objects.deployment.Deployment
) are initialized manually:then they will not have access to the custom client because there is no direct link to the currently active test client. it could be added in the future, but that requires a hard look at the design and any implications it would have, particularly if tests are run in parallel. For now, if its required that an object is initialized directly, the
api_client
can be passed directly to itRelated: