@@ -237,8 +237,7 @@ private String simulateHelmRendering(List<String> allRbac) {
237237        vars .put (".Values.operator.readinessProbe.periodSeconds" , "30" );
238238        vars .put (".Values.operator.readinessProbe.successThreshold" , "1" );
239239        vars .put (".Values.operator.readinessProbe.timeoutSeconds" , "10" );
240-         vars .put (".Values.nodeSelector" , "        {}" );
241-         vars .put (".Values.operator.nodeSelector" , "        {}" );
240+         vars .put ("$nodeSelector" , "        {}" );
242241        vars .put (".Values.operator.tolerations" , "        []" );
243242        vars .put ("include \" kaap.name\"  ." , "kaap" );
244243        vars .put ("include \" kaap.roleName\"  ." , "kaap" );
@@ -249,9 +248,9 @@ private String simulateHelmRendering(List<String> allRbac) {
249248        vars .put ("include \" kaap.selectorLabels\"  . | nindent 8" , "{app.kubernetes.io/name: kaap}" );
250249        vars .put ("include (print $.Template.BasePath \" /configmap.yaml\" ) . | sha256sum" , "sha" );
251250        String  result  = "" ;
252-         // simulate go  templating 
251+         // simulate Helm  templating 
253252        for  (String  l  : allRbac ) {
254-             if  (l .contains ("nodeSelector"  ) ||  l . contains ( ".nodeSelector" )) { // nodeselector is empty anyway. This resolves duplicate nodeselectors  
253+             if  (l .contains ("{{- $"  )) { // ignore variable definitions  
255254                continue ;
256255            }
257256            if  (l .contains ("{{- if" )) { // assume always true and no content other than the if 
@@ -268,7 +267,7 @@ private String simulateHelmRendering(List<String> allRbac) {
268267            result  += l  + System .lineSeparator ();
269268        }
270269        if  (result .contains ("{{" )) {
271-             throw  new  RuntimeException ("Failed to replace all go  templating vars, template: "  + result );
270+             throw  new  RuntimeException ("Failed to replace all Helm  templating vars, template: "  + result );
272271        }
273272        return  result ;
274273    }
0 commit comments