Browse Source

Merge pull request #7123 from ewolinetz/logging_ops_patch

Automatic merge from submit-queue.

Correctly comparing against the current configmap when making es conf…

…igmap patches

Found when trying to recreate bz locally.
Does not currently have a bz opened against it but needs to be resolved.
OpenShift Merge Robot 7 years ago
parent
commit
7c8513d5bd

+ 8 - 2
roles/openshift_logging/tasks/patch_configmap_file.yaml

@@ -18,18 +18,24 @@
 - copy:
     content: "{{ __configmap_output.results.results[0]['data'][configmap_current_file] }}"
     dest: "{{ tempdir }}/current.yml"
+  when: configmap_current_file in __configmap_output.results.results[0]['data']
 
 - logging_patch:
     original_file: "{{ tempdir }}/current.yml"
     new_file: "{{ configmap_new_file }}"
     whitelist: "{{ configmap_protected_lines | default([]) }}"
   register: patch_output
+  when: configmap_current_file in __configmap_output.results.results[0]['data']
 
 - copy:
     content: "{{ patch_output.raw_patch }}\n"
     dest: "{{ tempdir }}/patch.patch"
-  when: patch_output.raw_patch | length > 0
+  when:
+  - patch_output.raw_patch is defined
+  - patch_output.raw_patch | length > 0
 
 - command: >
     patch --force --quiet -u "{{ configmap_new_file }}" "{{ tempdir }}/patch.patch"
-  when: patch_output.raw_patch | length > 0
+  when:
+  - patch_output.raw_patch is defined
+  - patch_output.raw_patch | length > 0

+ 2 - 2
roles/openshift_logging_elasticsearch/tasks/main.yaml

@@ -214,7 +214,7 @@
       name: openshift_logging
       tasks_from: patch_configmap_files.yaml
     vars:
-      configmap_name: "logging-elasticsearch"
+      configmap_name: "{{ elasticsearch_name }}"
       configmap_namespace: "logging"
       configmap_file_names:
       - current_file: "elasticsearch.yml"
@@ -247,7 +247,7 @@
       name: openshift_logging
       tasks_from: patch_configmap_files.yaml
     vars:
-      configmap_name: "logging-elasticsearch"
+      configmap_name: "{{ elasticsearch_name }}"
       configmap_namespace: "logging"
       configmap_file_names:
       - current_file: "elasticsearch.yml"