diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2018-01-17 23:57:13 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-01-17 23:57:13 -0800 |
commit | 6a69cb8e4f7835b54ee339a5ff4e8b5a899997fd (patch) | |
tree | 31682088ef90beb931b1de40200c8ac0ce436fc1 /roles | |
parent | 10f4ab5f65a9797aabd0ba3ec3d88d6b36c1432c (diff) | |
parent | 4d96cbb81d758af87da6ef547aa655afcbc9995d (diff) | |
download | openshift-6a69cb8e4f7835b54ee339a5ff4e8b5a899997fd.tar.gz openshift-6a69cb8e4f7835b54ee339a5ff4e8b5a899997fd.tar.bz2 openshift-6a69cb8e4f7835b54ee339a5ff4e8b5a899997fd.tar.xz openshift-6a69cb8e4f7835b54ee339a5ff4e8b5a899997fd.zip |
Merge pull request #6743 from ewolinetz/logging_find_running_pods
Automatic merge from submit-queue.
Ensure we are running oc execs against running pods
We should make sure we are running `oc exec` statements against running pods only.
Addresses https://bugzilla.redhat.com/show_bug.cgi?id=1534879
Diffstat (limited to 'roles')
-rw-r--r-- | roles/openshift_logging_elasticsearch/tasks/get_es_version.yml | 4 | ||||
-rw-r--r-- | roles/openshift_logging_elasticsearch/tasks/restart_cluster.yml | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/roles/openshift_logging_elasticsearch/tasks/get_es_version.yml b/roles/openshift_logging_elasticsearch/tasks/get_es_version.yml index 9182bddb2..16de6f252 100644 --- a/roles/openshift_logging_elasticsearch/tasks/get_es_version.yml +++ b/roles/openshift_logging_elasticsearch/tasks/get_es_version.yml @@ -1,6 +1,6 @@ --- - command: > - oc get pod -l component=es,provider=openshift -n {{ openshift_logging_elasticsearch_namespace }} -o jsonpath={.items[*].metadata.name} + oc get pod -l component=es,provider=openshift -n {{ openshift_logging_elasticsearch_namespace }} -o jsonpath={.items[?(@.status.phase==\"Running\")].metadata.name} register: _cluster_pods - name: "Getting ES version for logging-es cluster" @@ -10,7 +10,7 @@ when: _cluster_pods.stdout_lines | count > 0 - command: > - oc get pod -l component=es-ops,provider=openshift -n {{ openshift_logging_elasticsearch_namespace }} -o jsonpath={.items[*].metadata.name} + oc get pod -l component=es-ops,provider=openshift -n {{ openshift_logging_elasticsearch_namespace }} -o jsonpath={.items[?(@.status.phase==\"Running\")].metadata.name} register: _ops_cluster_pods - name: "Getting ES version for logging-es-ops cluster" diff --git a/roles/openshift_logging_elasticsearch/tasks/restart_cluster.yml b/roles/openshift_logging_elasticsearch/tasks/restart_cluster.yml index d55beec86..6bce13d1d 100644 --- a/roles/openshift_logging_elasticsearch/tasks/restart_cluster.yml +++ b/roles/openshift_logging_elasticsearch/tasks/restart_cluster.yml @@ -19,7 +19,7 @@ ## get all pods for the cluster - command: > - oc get pod -l component={{ _cluster_component }},provider=openshift -n {{ openshift_logging_elasticsearch_namespace }} -o jsonpath={.items[*].metadata.name} + oc get pod -l component={{ _cluster_component }},provider=openshift -n {{ openshift_logging_elasticsearch_namespace }} -o jsonpath={.items[?(@.status.phase==\"Running\")].metadata.name} register: _cluster_pods - name: "Disable shard balancing for logging-{{ _cluster_component }} cluster" @@ -64,7 +64,7 @@ ## we may need a new first pod to run against -- fetch them all again - command: > - oc get pod -l component={{ _cluster_component }},provider=openshift -n {{ openshift_logging_elasticsearch_namespace }} -o jsonpath={.items[*].metadata.name} + oc get pod -l component={{ _cluster_component }},provider=openshift -n {{ openshift_logging_elasticsearch_namespace }} -o jsonpath={.items[?(@.status.phase==\"Running\")].metadata.name} register: _cluster_pods - name: "Enable shard balancing for logging-{{ _cluster_component }} cluster" |