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 <nyarly@gmail.com>
This commit is contained in:
Judson committed 2020-06-24 10:30:26 -07:00
1 parent c143bdb68d
commit f89ecb6156
1 file changed
+2 -1
@@ -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