From c8e401f5ad32b27826519ea39d8bbbf402c99626 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Guilherme=20Vanz?= Date: Thu, 14 Sep 2023 10:55:59 -0300 Subject: [PATCH] fix: wrong if statement to install policy report CRDs. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The install_crds.sh script used by updatecli to install new version of the CRDs is missing a logic clause in the if statement to check if the policy report CRDs should be installed. This commit fixed that by adding the missing "or" logic. Signed-off-by: José Guilherme Vanz --- updatecli/scripts/install_crds.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/updatecli/scripts/install_crds.sh b/updatecli/scripts/install_crds.sh index 85907815..5a8809a3 100755 --- a/updatecli/scripts/install_crds.sh +++ b/updatecli/scripts/install_crds.sh @@ -9,9 +9,9 @@ tar -xvf /tmp/crds-audit-scanner.tar.gz find . -maxdepth 1 -name "*_clusterpolicyreports*" -exec mv \{\} charts/kubewarden-crds/templates/clusterpolicyreports.yaml \; find . -maxdepth 1 -name "*_policyreports*" -exec mv \{\} charts/kubewarden-crds/templates/policyreports.yaml \; # add the if statement to allow users to skip the reports CRDs installation -sed -i '1 i {{- if .Values.installPolicyReportCRDs }}' charts/kubewarden-crds/templates/clusterpolicyreports.yaml +sed -i '1 i {{- if or .Values.installPolicyReportCRDs (not (hasKey .Values "installPolicyReportCRDs")) }}' charts/kubewarden-crds/templates/clusterpolicyreports.yaml sed -i '$ a {{ end }}' charts/kubewarden-crds/templates/clusterpolicyreports.yaml -sed -i '1 i {{- if .Values.installPolicyReportCRDs }}' charts/kubewarden-crds/templates/policyreports.yaml +sed -i '1 i {{- if or .Values.installPolicyReportCRDs (not (hasKey .Values "installPolicyReportCRDs")) }}' charts/kubewarden-crds/templates/policyreports.yaml sed -i '$ a {{ end }}' charts/kubewarden-crds/templates/policyreports.yaml # updatecli expects something in stdout when a change happened.