Преглед изворни кода

Merge pull request #11871 from mtnbikenc/fix-1746926

Bug 1746926: Conditionally handle base64 encoded data for registries.conf
OpenShift Merge Robot пре 5 година
родитељ
комит
667a47ff72
1 измењених фајлова са 6 додато и 1 уклоњено
  1. 6 1
      roles/openshift_node/tasks/config.yml

+ 6 - 1
roles/openshift_node/tasks/config.yml

@@ -68,9 +68,14 @@
       | last
       }}
 
+- name: Check data URL encoding and extract source data
+  set_fact:
+    base64encoded: "{{ registries_conf.contents.source.split(',')[0].endswith('base64') }}"
+    source_data: "{{ registries_conf.contents.source.split(',')[1] }}"
+
 - name: Write /etc/containers/registries.conf
   copy:
-    content: "{{ registries_conf.contents.source.split(',')[1] | urldecode }}"
+    content: "{{ (source_data | b64decode) if base64encoded else (source_data | urldecode) }}"
     mode: "{{ '0' ~ registries_conf.mode }}"
     dest: "{{ registries_conf.path }}"
   register: update_registries