Skip to content

Commit

Permalink
Merge pull request #83 from pdecat/fix-volume-configmap-items-mode
Browse files Browse the repository at this point in the history
Fix mode conversion with config_map volume items
  • Loading branch information
radeksimko authored Oct 29, 2017
2 parents 893828d + 8bca3b4 commit 9f80081
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
25 changes: 25 additions & 0 deletions kubernetes/resource_kubernetes_pod_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion kubernetes/structures_pod.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 9f80081

Please sign in to comment.