Normalize a blank string to 0.0.0.0 (#128)

Works around a problem in Windows on Docker, which doesn't support providing an IP to to bind to for ports
This commit is contained in:
Seb Patane 2019-03-07 20:15:42 +11:00 committed by Manuel Vogel
parent 1ac859bd81
commit 1c68029ce9

View file

@ -253,6 +253,14 @@ func resourceDockerContainer() *schema.Resource {
Default: "0.0.0.0",
Optional: true,
ForceNew: true,
StateFunc: func(val interface{}) string {
// Empty IP assignments default to 0.0.0.0
if val.(string) == "" {
return "0.0.0.0"
}
return val.(string)
},
},
"protocol": &schema.Schema{