The controller of the configMap of the pod's volume without the Name field parameter reports an error #2491
-
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hello, It seems like you're correctly trying to associate a ConfigMap to a Volume in a Pod specification. The Name field you're referring to indeed does not directly exist under the ConfigMapVolumeSource object. Instead, it is present under the LocalObjectReference object, as you've shown in your code. To fix you would need to probably: ConfigMap: &corev1.ConfigMapVolumeSource{
LocalObjectReference: corev1.LocalObjectReference{
Name: zapi.Spec.ConfigMap,
},
DefaultMode: &configMapMode,
} Here, the Name field inside LocalObjectReference is what maps to the name of the ConfigMap you want to mount. I hope that answered your question. |
Beta Was this translation helpful? Give feedback.
Hello,
It seems like you're correctly trying to associate a ConfigMap to a Volume in a Pod specification. The Name field you're referring to indeed does not directly exist under the ConfigMapVolumeSource object. Instead, it is present under the LocalObjectReference object, as you've shown in your code.
To fix you would need to probably:
Here, the Name field inside LocalObjectReference is what maps to the name of the ConfigMap you want to mount.
I hope that answered your question.
I am closing this one since it was ope…