Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

envFrom/ConfigMapRef not working with custom resource definition (CRD) #681

Closed
johnhny opened this issue Jan 9, 2019 · 2 comments
Closed

Comments

@johnhny
Copy link

johnhny commented Jan 9, 2019

Hi everybody

First of all: Thanks for the amazing work! 👏🎉

#97 Contains a link to a repo that shows how to use Kustomize with OpenShift Extensions: https://github.com/adnovum/kustomize-openshift

According to this, we created a CRD for DeploymentConfig, that enables Kustomize to update the ConfigMap Reference (containing the hash) for template/spec/volumes/configMap
-> https://github.com/johnhny/kustomize-configMapRef-bug/blob/master/result_actual.yml#L48
-> works like a charm 👍

In the same manner we tried to do this for template/spec/containers/envFrom/configMapRef.
It turns out, the resulting yaml is still missing the "-v1" suffix:
-> https://github.com/johnhny/kustomize-configMapRef-bug/blob/master/result_actual.yml#L38
-> crd seems not work -> missing the "-v1" suffix 😕

We do not understand, why it works correctly for template/spec/volumes/configMap but not for template/spec/containers/envFrom/configMapRef. Can you give us a hint?

I created an example-repo, that shows the issue (with the expected and actual output files):
https://github.com/johnhny/kustomize-configMapRef-bug

We are using Version 1.0.11 of Kustomize, which should contain a fix for suspicious Bug #554

$ kustomize version
Version: {KustomizeVersion:1.0.11 GitCommit:8f701a00417a812558a7b785e8354957afa469ae BuildDate:2018-12-04T18:42:24Z GoOs:unknown GoArch:unknown}
@Liujingfang1
Copy link
Contributor

@johnhny I took a look at your openshift-deploymentconfig.json file. You need to change the annotations for "template/spec/containers/envFrom/configMapRef" to following

		"template/spec/containers/envFrom/configMapRef": {
					"x-kubernetes-object-ref-api-version": "v1",
					"x-kubernetes-object-ref-kind": "ConfigMap"
	       }

The meaning is as this. The path template/spec/containers/envFrom/configMapRef refers to an object. That object has the apiversion v1 and kind ConfigMap.

johnhny pushed a commit to johnhny/kustomize-configMapRef-bug that referenced this issue Jan 15, 2019
@johnhny
Copy link
Author

johnhny commented Jan 15, 2019

Thanks so much for the help 🙏😃

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants