From f26e16bf7931cd0546395458a6829a3909ef2fa1 Mon Sep 17 00:00:00 2001 From: Shravan Papanaidu Date: Wed, 4 Apr 2018 13:26:16 -0700 Subject: [PATCH] kubectl get pods from 'test' namespace as the pods were created in 'test' ns --- tests/testcases/030_check-network.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/testcases/030_check-network.yml b/tests/testcases/030_check-network.yml index 2fa78545f..531b84c06 100644 --- a/tests/testcases/030_check-network.yml +++ b/tests/testcases/030_check-network.yml @@ -14,7 +14,7 @@ - name: Wait for pods to be ready - shell: "{{bin_dir}}/kubectl get pods" + shell: "{{bin_dir}}/kubectl get pods -n test" register: pods until: - '"ContainerCreating" not in pods.stdout' @@ -25,18 +25,18 @@ no_log: true - name: Get pod names - shell: "{{bin_dir}}/kubectl get pods -o json" + shell: "{{bin_dir}}/kubectl get pods -n test -o json" register: pods no_log: true - name: Get hostnet pods - command: "{{bin_dir}}/kubectl get pods -o + command: "{{bin_dir}}/kubectl get pods -n test -o jsonpath='{range .items[?(.spec.hostNetwork)]}{.metadata.name} {.status.podIP} {.status.containerStatuses} {end}'" register: hostnet_pods no_log: true - name: Get running pods - command: "{{bin_dir}}/kubectl get pods -o + command: "{{bin_dir}}/kubectl get pods -n test -o jsonpath='{range .items[?(.status.phase==\"Running\")]}{.metadata.name} {.status.podIP} {.status.containerStatuses} {end}'" register: running_pods no_log: true