cilium-cli icon indicating copy to clipboard operation
cilium-cli copied to clipboard

Helm template command might result in boolean ConfigMap values

Open raphink opened this issue 3 years ago • 3 comments
trafficstars

Bug report

When passing a extra config map values to the command line, if these values can be interpreted as boolean, the cilium-cli will output a helm template command that will result in an invalid YAML.

E.g.

cilium install --version -service-mesh:v1.11.0-beta.1 --config enable-envoy-config=true

outputs:

helm template --namespace kube-system cilium cilium/cilium --version 1.11.3 --set cluster.id=0,cluster.name=kind-kind,clustermesh.apiserver.image.tag=-service-mesh:v1.11.0-beta.1,clustermesh.apiserver.image.useDigest=false,encryption.nodeEncryption=false,extraConfig.enable-envoy-config=true,hubble.relay.image.tag=-service-mesh:v1.11.0-beta.1,hubble.relay.image.useDigest=false,image.tag=-service-mesh:v1.11.0-beta.1,image.useDigest=false,ipam.mode=kubernetes,kubeProxyReplacement=disabled,operator.image.digest=false,operator.image.tag=-service-mesh:v1.11.0-beta.1,operator.replicas=1,preflight.image.tag=-service-mesh:v1.11.0-beta.1,preflight.image.useDigest=false,serviceAccounts.cilium.name=cilium,serviceAccounts.operator.name=cilium-operator,tunnel=vxlan

where

--set extraConfig.enable-envoy-config=true

will result in the verbatim true added as the value for enable-envoy-config in the cilium-config ConfigMap, which is invalid.

One way to fix this would be to use --set-string instead of --set for extraConfig parameters.

General Information

  • Cilium CLI version (run cilium version): v0.11.1 compiled with go1.18.1 on linux/amd64

raphink avatar Apr 25 '22 12:04 raphink

@raphink I think this should be fixed in cilium/cilium instead. I tried --set extraConfig.enable-envoy-config="true" and also failed.

aanm avatar Apr 25 '22 13:04 aanm

Yes @aanm, you need to pass --set-string extraConfig.enable-envoy-config=true

raphink avatar Apr 25 '22 13:04 raphink

It could be fixed in the helm chart in cilium/cilium instead, but that would mean replacing the current {{ toYaml .Values.extraConfig | nindent 2 }} with a loop over each parameter to force quoting on each value.

raphink avatar Apr 25 '22 13:04 raphink