Skip to content

Commit

Permalink
reify the list values before validation
Browse files Browse the repository at this point in the history
If the list was marked as computed, all values will be raw config
values. Fetch the individual keys from the config to get any known
values before validating.
  • Loading branch information
jbardin committed Mar 24, 2017
1 parent 3d3d2c1 commit d6744fa
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions helper/schema/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -1219,6 +1219,13 @@ func (m schemaMap) validateList(
for i, raw := range raws {
key := fmt.Sprintf("%s.%d", k, i)

// Reify the key value from the ResourceConfig.
// If the list was computed we have all raw values, but some of these
// may be known in the config, and aren't individually marked as Computed.
if r, ok := c.Get(key); ok {
raw = r
}

var ws2 []string
var es2 []error
switch t := schema.Elem.(type) {
Expand Down

0 comments on commit d6744fa

Please sign in to comment.