Skip to content

Commit

Permalink
fix: Ensure installation of PolicyReport CRDs if value is missing or …
Browse files Browse the repository at this point in the history
…set to "null".

In the Rancher manager environment, an issue arises during updates of
the kubewarden-crds chart where the "installPolicyReportCRDs"
configuration is sometimes set to "null." This results in problems as
the CRDs, which should be installed by default, are not deployed. To
address this issue, we've enhanced the conditional logic to install the
CRDs when the flag is explicitly set to true or when it is missing
altogether.

Signed-off-by: José Guilherme Vanz <[email protected]>
  • Loading branch information
jvanz committed Sep 11, 2023
1 parent 6139c90 commit 8246435
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion charts/kubewarden-crds/templates/clusterpolicyreports.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if .Values.installPolicyReportCRDs }}
{{- if or .Values.installPolicyReportCRDs (not (hasKey .Values "installPolicyReportCRDs")) }}
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
Expand Down
2 changes: 1 addition & 1 deletion charts/kubewarden-crds/templates/policyreports.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if .Values.installPolicyReportCRDs }}
{{- if or .Values.installPolicyReportCRDs (not (hasKey .Values "installPolicyReportCRDs")) }}
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
Expand Down

0 comments on commit 8246435

Please sign in to comment.