istio: Invalid env var marshalling in k8s resource spec

$ ik manifest generate --set values.pilot.env.ISTIOD_CUSTOM_HOST=1.2.3.4 -f ex.yaml
Error: could not unmarshal merged YAML: json: cannot unmarshal object into Go value of type []json.RawMessage

YAML:
apiVersion: install.istio.io/v1alpha1
kind: IstioOperator
metadata:
  namespace: external-istiod
spec:
  components:
    base:
      enabled: true
    cni:
      enabled: false
    egressGateways:
    - enabled: false
      name: istio-egressgateway
    ingressGateways:
    - enabled: true
      name: istio-ingressgateway
    istiodRemote:
      enabled: false
    pilot:
      enabled: true
      k8s:
        env:
          name: ISTIOD_CUSTOM_HOST
          value: 1.2.3.4

IOP:

    apiVersion: install.istio.io/v1alpha1
    kind: IstioOperator
    metadata:
      namespace: external-istiod
    spec:
      components:
        pilot:
          enabled: true
          k8s:
            env:

if env is removed, this doesn’t have issues

cc @morvencao

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 15 (14 by maintainers)

Most upvoted comments

you need the iop above AND the set flag

On Thu, Mar 25, 2021, 7:30 PM Morven Cao @.***> wrote:

Which version are you using? I didn’t see this error in 1.8.4, 1.9.2 and master if we just add --set values.pilot.env.ISTIOD_CUSTOM_HOST=1.2.3.4:

$ ./out/linux_amd64/istioctl manifest generate --set values.pilot.env.ISTIOD_CUSTOM_HOST=1.2.3.4 2>&1 1>/dev/null

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/istio/istio/issues/31690#issuecomment-807888982, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAEYGXLO2J5QKVFMCREJCCLTFPWT5ANCNFSM4ZYEHWSQ .