Getting following errors after kustomize edit set image

It happens to any files with configMapGenerator and fieldpath
Example:
Before
```configMapGenerator:
After
```configMapGenerator:
- envs:
- params.env
name: workflow-controller-parameters
generatorOptions:
disableNameSuffixHash: true
vars:
- fieldref:
fieldPath: data.executorImage
name: executorImage
objref:
apiVersion: v1
kind: ConfigMap
name: workflow-controller-parameters
@ivanliu1989 This does not look like a bug.
your original file seems to be missing the first line. If you add it back like this:
generatorOptions:
disableNameSuffixHash: true
configMapGenerator:
- name: workflow-controller-parameters
env: params.env
vars:
- name: executorImage
objref:
kind: ConfigMap
name: workflow-controller-parameters
apiVersion: v1
fieldref:
fieldpath: data.executorImage
then
kustomize build .
works
2019/09/06 13:22:57 well-defined vars that were never replaced: executorImage
apiVersion: v1
data:
executorImage: 1.2.3
kind: ConfigMap
metadata:
name: workflow-controller-parameters
then if you use edit image:
kustomize edit set image node:8.15.0
kustomization.yaml looks like this (not the configmap generator is updated to support more than one file)
generatorOptions:
disableNameSuffixHash: true
configMapGenerator:
- envs:
- params.env
name: workflow-controller-parameters
vars:
- fieldref:
fieldPath: data.executorImage
name: executorImage
objref:
apiVersion: v1
kind: ConfigMap
name: workflow-controller-parameters
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
images:
- name: node
newTag: 8.15.0
kustomize build still works
kustomize build .
apiVersion: v1
data:
executorImage: 1.2.3
kind: ConfigMap
metadata:
name: workflow-controller-parameters
Hi jbrette, thanks for your reply. I think you are right, it's actually not a bug from kustomize but from the executable I am using from another tool. Sorry to post it here but really appreciated your help!
Most helpful comment
@ivanliu1989 This does not look like a bug.
your original file seems to be missing the first line. If you add it back like this:
then
works
then if you use edit image:
kustomization.yaml looks like this (not the configmap generator is updated to support more than one file)
kustomize build still works