diff --git a/builtin/providers/docker/provider.go b/builtin/providers/docker/provider.go index 2fe456e93c..fdc8b77194 100644 --- a/builtin/providers/docker/provider.go +++ b/builtin/providers/docker/provider.go @@ -20,7 +20,7 @@ func Provider() terraform.ResourceProvider { "cert_path": &schema.Schema{ Type: schema.TypeString, Optional: true, - DefaultFunc: schema.EnvDefaultFunc("DOCKER_CERT_PATH", nil), + DefaultFunc: schema.EnvDefaultFunc("DOCKER_CERT_PATH", ""), Description: "Path to directory with Docker TLS config", }, }, diff --git a/helper/schema/schema_test.go b/helper/schema/schema_test.go index 2c9e89f63e..c1233ae50b 100644 --- a/helper/schema/schema_test.go +++ b/helper/schema/schema_test.go @@ -2322,6 +2322,24 @@ func TestSchemaMap_Input(t *testing.T) { Err: false, }, + "input ignored when default function returns an empty string": { + Schema: map[string]*Schema{ + "availability_zone": &Schema{ + Type: TypeString, + Default: "", + Optional: true, + }, + }, + + Input: map[string]string{ + "availability_zone": "bar", + }, + + Result: map[string]interface{}{}, + + Err: false, + }, + "input used when default function returns nil": { Schema: map[string]*Schema{ "availability_zone": &Schema{