mirror of
https://github.com/kreuzwerker/terraform-provider-docker.git
synced 2026-02-18 01:57:51 -05:00
* Fix panic to migrate schema from v0 to v1 * Remove Computed setting from docker_container.env to suppress diff * Remove Computed setting from docker_container.labels to suppress diff
This commit is contained in:
parent
06a1b8880a
commit
863fc4cb38
2 changed files with 8 additions and 3 deletions
|
|
@ -15,7 +15,14 @@ func replaceLabelsMapFieldWithSetField(rawState map[string]interface{}) map[stri
|
|||
func migrateContainerLabels(rawState map[string]interface{}) map[string]interface{} {
|
||||
replaceLabelsMapFieldWithSetField(rawState)
|
||||
|
||||
mounts := rawState["mounts"].([]interface{})
|
||||
m, ok := rawState["mounts"]
|
||||
if !ok || m == nil {
|
||||
// https://github.com/terraform-providers/terraform-provider-docker/issues/264
|
||||
rawState["mounts"] = []interface{}{}
|
||||
return rawState
|
||||
}
|
||||
|
||||
mounts := m.([]interface{})
|
||||
newMounts := make([]interface{}, len(mounts))
|
||||
for i, mountI := range mounts {
|
||||
mount := mountI.(map[string]interface{})
|
||||
|
|
|
|||
|
|
@ -459,7 +459,6 @@ func resourceDockerContainer() *schema.Resource {
|
|||
Type: schema.TypeSet,
|
||||
Optional: true,
|
||||
ForceNew: true,
|
||||
Computed: true,
|
||||
Elem: &schema.Schema{Type: schema.TypeString},
|
||||
Set: schema.HashString,
|
||||
},
|
||||
|
|
@ -563,7 +562,6 @@ func resourceDockerContainer() *schema.Resource {
|
|||
Type: schema.TypeSet,
|
||||
Optional: true,
|
||||
ForceNew: true,
|
||||
Computed: true,
|
||||
Elem: labelSchema,
|
||||
},
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue