Created
June 24, 2018 02:34
-
-
Save samirbehara-zz/12ac713d1dec879d1c1b542f2d6b936e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def test_to_list_pods_for_specific_namespace(k8s_client): | |
ret = k8s_client.list_namespaced_pod("default") | |
podcount = len(ret.items) | |
print(podcount) | |
assert(podcount > 0) | |
# Iterate through all the pods in the default namespace and list down the pod name and respective namespace | |
for item in ret.items: | |
print("%s\t%s\t" % (item.metadata.name, item.metadata.namespace)) | |
def test_to_list_services_for_specific_namespace(k8s_client): | |
ret = k8s_client.list_namespaced_service("default") | |
svccount = len(ret.items) | |
print(svccount) | |
assert(svccount > 0) | |
# Iterate through all the services in the default namespace and list down the service name and respective namespace | |
for item in ret.items: | |
print("%s\t%s\t" % (item.metadata.name, item.metadata.namespace)) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment