acceptance-testing icon indicating copy to clipboard operation
acceptance-testing copied to clipboard

Replace kubectl with Kubernetes Python client

Open jdolitsky opened this issue 6 years ago • 4 comments

Instead of shelling out to kubectl, should just import and use the Python library: https://github.com/kubernetes-client/python

jdolitsky avatar Jul 23 '19 17:07 jdolitsky

/assign

akashshinde avatar Nov 20 '19 05:11 akashshinde

I wonder if such a change would actually cause the code to be harder to maintain? With the use of our Sh.py package, it is often straightforward to use kubectl. Such as:

Should pass  kubectl get nodes
Sh.Run  kubectl get pods --namespace=default

@jdolitsky do you still see this issue as a valuable improvement?

marckhouzam avatar Nov 20 '19 20:11 marckhouzam

@marckhouzam I think for commands which require counting number of results etc. this would simply alot

For example this function: https://github.com/helm/acceptance-testing/blob/master/lib/Kubectl.py#L17

jdolitsky avatar Dec 03 '19 18:12 jdolitsky

Agreed

marckhouzam avatar Dec 03 '19 18:12 marckhouzam