From 83de35e1a4bca2050474788fff30dd2f997bc50b Mon Sep 17 00:00:00 2001 From: Alex Luong Date: Thu, 9 May 2024 20:55:33 +0700 Subject: [PATCH] fix: Count unknown value as present during attribute validation (#58) --- internal/validators/AtLeastOneChild.go | 2 +- internal/validators/ExactlyOneChild.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/validators/AtLeastOneChild.go b/internal/validators/AtLeastOneChild.go index e2af85d..7623fc8 100644 --- a/internal/validators/AtLeastOneChild.go +++ b/internal/validators/AtLeastOneChild.go @@ -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 diff --git a/internal/validators/ExactlyOneChild.go b/internal/validators/ExactlyOneChild.go index f02e814..1f8f23a 100644 --- a/internal/validators/ExactlyOneChild.go +++ b/internal/validators/ExactlyOneChild.go @@ -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