Skip to content

Commit

Permalink
fix: Count unknown value as present during attribute validation (#58)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexluong authored May 9, 2024
1 parent 035d3dc commit 83de35e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion internal/validators/AtLeastOneChild.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func (validator atLeastOneChild) ValidateObject(ctx context.Context, req validat
defined := make(map[string]bool)
count := 0
for key, attr := range req.ConfigValue.Attributes() {
if attr.IsUnknown() || attr.IsNull() {
if attr.IsNull() {
continue
}
defined[key] = true
Expand Down
2 changes: 1 addition & 1 deletion internal/validators/ExactlyOneChild.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func (validator exactlyOneChild) ValidateObject(ctx context.Context, req validat
defined := make(map[string]bool)
count := 0
for key, attr := range req.ConfigValue.Attributes() {
if attr.IsUnknown() || attr.IsNull() {
if attr.IsNull() {
continue
}
defined[key] = true
Expand Down

0 comments on commit 83de35e

Please sign in to comment.