diff options
author | Nathan Dench <ndenc2@gmail.com> | 2019-05-24 15:16:44 +1000 |
---|---|---|
committer | Nathan Dench <ndenc2@gmail.com> | 2019-05-24 15:16:44 +1000 |
commit | 107c1cdb09c575aa2f61d97f48d8587eb6bada4c (patch) | |
tree | ca7d008643efc555c388baeaf1d986e0b6b3e28c /vendor/github.com/hashicorp/terraform/helper/schema/field_reader_config.go | |
parent | 844b5a68d8af4791755b8f0ad293cc99f5959183 (diff) | |
download | terraform-provider-statuscake-107c1cdb09c575aa2f61d97f48d8587eb6bada4c.tar.gz terraform-provider-statuscake-107c1cdb09c575aa2f61d97f48d8587eb6bada4c.tar.zst terraform-provider-statuscake-107c1cdb09c575aa2f61d97f48d8587eb6bada4c.zip |
Upgrade to 0.12
Diffstat (limited to 'vendor/github.com/hashicorp/terraform/helper/schema/field_reader_config.go')
-rw-r--r-- | vendor/github.com/hashicorp/terraform/helper/schema/field_reader_config.go | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/vendor/github.com/hashicorp/terraform/helper/schema/field_reader_config.go b/vendor/github.com/hashicorp/terraform/helper/schema/field_reader_config.go index 55a301d..808375c 100644 --- a/vendor/github.com/hashicorp/terraform/helper/schema/field_reader_config.go +++ b/vendor/github.com/hashicorp/terraform/helper/schema/field_reader_config.go | |||
@@ -2,6 +2,7 @@ package schema | |||
2 | 2 | ||
3 | import ( | 3 | import ( |
4 | "fmt" | 4 | "fmt" |
5 | "log" | ||
5 | "strconv" | 6 | "strconv" |
6 | "strings" | 7 | "strings" |
7 | "sync" | 8 | "sync" |
@@ -93,6 +94,22 @@ func (r *ConfigFieldReader) readField( | |||
93 | } | 94 | } |
94 | } | 95 | } |
95 | 96 | ||
97 | if protoVersion5 { | ||
98 | switch schema.Type { | ||
99 | case TypeList, TypeSet, TypeMap, typeObject: | ||
100 | // Check if the value itself is unknown. | ||
101 | // The new protocol shims will add unknown values to this list of | ||
102 | // ComputedKeys. This is the only way we have to indicate that a | ||
103 | // collection is unknown in the config | ||
104 | for _, unknown := range r.Config.ComputedKeys { | ||
105 | if k == unknown { | ||
106 | log.Printf("[DEBUG] setting computed for %q from ComputedKeys", k) | ||
107 | return FieldReadResult{Computed: true, Exists: true}, nil | ||
108 | } | ||
109 | } | ||
110 | } | ||
111 | } | ||
112 | |||
96 | switch schema.Type { | 113 | switch schema.Type { |
97 | case TypeBool, TypeFloat, TypeInt, TypeString: | 114 | case TypeBool, TypeFloat, TypeInt, TypeString: |
98 | return r.readPrimitive(k, schema) | 115 | return r.readPrimitive(k, schema) |