Kustomize: Error: json: unknown field "envs" when building the example in docs

Created on 13 May 2019  ยท  7Comments  ยท  Source: kubernetes-sigs/kustomize

It seems caused by the secretGenerator.

~/go/src/sigs.k8s.io/kustomize/ master
โฏ kustomize build docs
Error: json: unknown field "envs"

โฏ kustomize version
Version: {KustomizeVersion:v2.0.3 GitCommit:a6f65144121d1955266b0cd836ce954c04122dc8 BuildDate:2019-03-18T22:15:21+00:00 GoOs:darwin GoArch:amd64}

The error will disappear if we modify envs to env, e.g.

secretGenerator:
- name: env_file_secret
  # paths to files with k=v pairs, one pair per line.
  env: env.txt
  type: Opaque

Is there a change in the spec recently?

Most helpful comment

Does this change have Backward compatibility? I think this should be considered.

All 7 comments

@yujunz Yes, the env is changed to envs recently in #1041.

Note if you are using kubectl 1.15.3, it's still env and not a list as shown above.

Does this change have Backward compatibility? I think this should be considered.

It looks like the Kustomize docs still refer to the old env property: https://kubectl.docs.kubernetes.io/pages/reference/kustomize.html#secretgenerator

Just got caught by Error: json: unknown field "env" and was lucky to find this issue. Using envs: worked.

env -> envs also applies to configMapGenerators (kubectl v1.18, kustomize v3.8.1)

Relates to #2205 and #2506

Was this page helpful?
0 / 5 - 0 ratings

Related issues

davidsbond picture davidsbond  ยท  3Comments

drekle picture drekle  ยท  4Comments

nicks picture nicks  ยท  3Comments

bugbuilder picture bugbuilder  ยท  3Comments

natasha41575 picture natasha41575  ยท  3Comments