nonsensitive no longer produces error when applied to values that are not sensitive (#369)

Signed-off-by: Joao C Costa <joao.costa@kit-ar.com>
This commit is contained in:
Joao C Costa
2023-12-27 14:16:13 +00:00
committed by GitHub
parent 55651dca33
commit 28e6bce155
4 changed files with 8 additions and 10 deletions

View File

@@ -52,9 +52,6 @@ var NonsensitiveFunc = function.New(&function.Spec{
return args[0].Type(), nil
},
Impl: func(args []cty.Value, retType cty.Type) (ret cty.Value, err error) {
if args[0].IsKnown() && !args[0].HasMark(marks.Sensitive) {
return cty.DynamicVal, function.NewArgErrorf(0, "the given value is not sensitive, so this call is redundant")
}
v, m := args[0].Unmark()
delete(m, marks.Sensitive) // remove the sensitive marking
return v.WithMarks(m), nil