浏览代码

fix condition check in desired_csv search

Grega Bremec 7 月之前
父节点
当前提交
9bf9899e77
共有 1 个文件被更改,包括 5 次插入3 次删除
  1. 5 3
      playbooks/roles/deploy-operator/tasks/main.yml

+ 5 - 3
playbooks/roles/deploy-operator/tasks/main.yml

@@ -70,18 +70,20 @@
       register: pkg_mft_samecat
 
     # XXX Then, search for the operator that has the status.packageName we need.
+    - name: Reset pkg_mft before looking for it
+      set_fact:
+        pkg_mft: ''
+
     - name: Weed out the manifest we need
       set_fact:
         pkg_mft: '{{ pkg_mft_samecat | community.general.json_query("resources[?status.packageName == `" + op.op_pkg + "`]") }}'
 
-    - debug: var=pkg_mft
-
     - name: Search for any channels that provide desired_csv
       set_fact:
         found_chn: '{{ (pkg_mft | community.general.json_query("status.channels[?currentCSV == `" + op.desired_csv + "`].name")) }}'
       when:
         - pkg_mft is defined
-        - pkg_mft.resources | length > 0
+        - pkg_mft != ''
 
     - name: Fail if no channel provides the desired_csv
       fail: