diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2018-01-17 13:56:42 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-01-17 13:56:42 -0800 |
commit | 7e83e65fc7a76df0530a56e3f6e3897cb95c316d (patch) | |
tree | 337096dab9658fc7413af71b7a3eb6bb98c2050a /roles/openshift_metrics/tasks | |
parent | fba3c1c4f3ffc1f0341a20192d392f16bf7659f4 (diff) | |
parent | 1dc910c68f845022f8749708bf191907e11efc13 (diff) | |
download | openshift-7e83e65fc7a76df0530a56e3f6e3897cb95c316d.tar.gz openshift-7e83e65fc7a76df0530a56e3f6e3897cb95c316d.tar.bz2 openshift-7e83e65fc7a76df0530a56e3f6e3897cb95c316d.tar.xz openshift-7e83e65fc7a76df0530a56e3f6e3897cb95c316d.zip |
Merge pull request #6751 from vrutkovs/apply-check-rc
Automatic merge from submit-queue.
Check that rc != 0 for steps with 'failed_when'
Some parts don't check the result rc at all, some check that 'error' is present there.
Instead the safest way is to check for both
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1534538
Diffstat (limited to 'roles/openshift_metrics/tasks')
-rw-r--r-- | roles/openshift_metrics/tasks/oc_apply.yaml | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/roles/openshift_metrics/tasks/oc_apply.yaml b/roles/openshift_metrics/tasks/oc_apply.yaml index 8ccfb7192..057963c1a 100644 --- a/roles/openshift_metrics/tasks/oc_apply.yaml +++ b/roles/openshift_metrics/tasks/oc_apply.yaml @@ -16,7 +16,9 @@ apply -f {{ file_name }} -n {{namespace}} register: generation_apply - failed_when: "'error' in generation_apply.stderr" + failed_when: + - "'error' in generation_apply.stderr" + - "generation_apply.rc != 0" changed_when: no - name: Determine change status of {{file_content.kind}} {{file_content.metadata.name}} @@ -28,5 +30,7 @@ register: version_changed vars: init_version: "{{ (generation_init is defined) | ternary(generation_init.stdout, '0') }}" - failed_when: "'error' in version_changed.stderr" + failed_when: + - "'error' in version_changed.stderr" + - "version_changed.rc != 0" changed_when: version_changed.stdout | int > init_version | int |