diff --git a/kubernetes/resource_kubernetes_pod_test.go b/kubernetes/resource_kubernetes_pod_test.go index d03c5e6c6c..14925f3970 100644 --- a/kubernetes/resource_kubernetes_pod_test.go +++ b/kubernetes/resource_kubernetes_pod_test.go @@ -897,6 +897,31 @@ resource "kubernetes_pod" "test" { default_mode = 0777 } } + + volume { + name = "cfg-item" + config_map { + name = "${kubernetes_config_map.test.metadata.0.name}" + + items { + key = "one" + path = "one.txt" + } + } + } + + volume { + name = "cfg-item-with-mode" + config_map { + name = "${kubernetes_config_map.test.metadata.0.name}" + + items { + key = "one" + path = "one-with-mode.txt" + mode = "0444" + } + } + } } } `, secretName, podName, imageName) diff --git a/kubernetes/structures_pod.go b/kubernetes/structures_pod.go index 770bdb93df..cf102d92c1 100644 --- a/kubernetes/structures_pod.go +++ b/kubernetes/structures_pod.go @@ -261,7 +261,7 @@ func flattenConfigMapVolumeSource(in *v1.ConfigMapVolumeSource) []interface{} { for i, v := range in.Items { m := map[string]interface{}{} m["key"] = v.Key - m["mode"] = v.Mode + m["mode"] = *v.Mode m["path"] = v.Path items[i] = m }