From f89ecb615695ffee602b76156b7b94104ee78dff Mon Sep 17 00:00:00 2001 From: Judson Date: Wed, 24 Jun 2020 10:25:51 -0700 Subject: [PATCH] ceph: helm chart fix for rook-ceph Go's template language doesn't treat infix `and` as a short-circuit, which led to fatal errors after an update in Go 1.14 surfaced that as a fatal error. This commit removes the infix `and` and replaces it with a default dict to handle the case of a missing Heml value. Closes: https://github.com/rook/rook/issues/5378 Signed-off-by: Judson --- cluster/charts/rook-ceph/templates/clusterrole.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cluster/charts/rook-ceph/templates/clusterrole.yaml b/cluster/charts/rook-ceph/templates/clusterrole.yaml index 7de6c0465..a0b1dbac6 100644 --- a/cluster/charts/rook-ceph/templates/clusterrole.yaml +++ b/cluster/charts/rook-ceph/templates/clusterrole.yaml @@ -281,7 +281,8 @@ rules: verbs: - get - list -{{- if ((.Values.agent) and .Values.agent.mountSecurityMode) and ne .Values.agent.mountSecurityMode "Any" }} +# Use a default dict to avoid 'can't give argument to non-function' errors from text/template +{{- if ne ((.Values.agent | default (dict "mountSecurityMode" "")).mountSecurityMode) "Any" }} --- apiVersion: rbac.authorization.k8s.io/v1beta1 kind: ClusterRole