Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

schema/ExactlyOneOf: Fix handling of unknowns in complex types #287

Merged
merged 3 commits into from
Jan 8, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions helper/schema/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -1508,13 +1508,13 @@ func validateExactlyOneAttribute(
specified := make([]string, 0)
unknownVariableValueCount := 0
for _, exactlyOneOfKey := range allKeys {
if raw, ok := c.Get(exactlyOneOfKey); ok {
if raw == hcl2shim.UnknownVariableValue {
// This aims to do a best effort check that at least one value is specified whether
// it's known or not.
unknownVariableValueCount++
continue
}
if c.IsComputed(exactlyOneOfKey) {
unknownVariableValueCount++
continue
}

_, ok := c.Get(exactlyOneOfKey)
if ok {
specified = append(specified, exactlyOneOfKey)
}
}
Expand Down
Loading