Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
def test_kubernetes_pod_status_is_running(k8s_client):
podlist = k8s_client.list_namespaced_pod("default")
# Iterate through all the pods in the default namespace and verify that they are Running
for item in podlist.items:
pod = k8s_client.read_namespaced_pod_status(namespace='default', name=item.metadata.name)
print("%s\t%s\t" % (item.metadata.name, item.metadata.namespace))
print(pod.status.phase)
assert(pod.status.phase == "Running" )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.