From 0f51b2e635b42983077331b42b067514ca20ad54 Mon Sep 17 00:00:00 2001 From: David Martin Date: Tue, 17 Apr 2018 17:45:09 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Fix=20the=20keycloak=20pod=20nam?= =?UTF-8?q?e=20selector...?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit So it doesn't give the below error when there are other pods with more than 1 container in the namespace ``` error executing jsonpath \"{.items[?(@.spec.containers[*].name==\\\"keycloak\\\")].metadata.name}\": can only compare one element at a time ``` --- roles/provision-keycloak-apb/tasks/provision-keycloak.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/provision-keycloak-apb/tasks/provision-keycloak.yml b/roles/provision-keycloak-apb/tasks/provision-keycloak.yml index b374ac5..383c9f2 100644 --- a/roles/provision-keycloak-apb/tasks/provision-keycloak.yml +++ b/roles/provision-keycloak-apb/tasks/provision-keycloak.yml @@ -113,7 +113,7 @@ dest: /tmp/keycloak-metrics-spi-1.0-SNAPSHOT.jar - name: Get the name of the keycloak pod - shell: oc get pods -n '{{ namespace }}' -o jsonpath='{.items[?(@.spec.containers[*].name=="keycloak")].metadata.name}' + shell: oc get pods -n '{{ namespace }}' -o jsonpath='{.items[?(@.spec.containers[0].name=="keycloak")].metadata.name}' register: keycloak_pod_name retries: 10 until: '"keycloak" in keycloak_pod_name.stdout'