Merge pull request #21863 from hashicorp/lookup-bool

Add missing bool case
This commit is contained in:
Paul Tyng 2019-06-26 11:19:10 -04:00 committed by GitHub
commit 7ec7af80f5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -689,8 +689,10 @@ var LookupFunc = function.New(&function.Spec{
return cty.StringVal(v.AsString()), nil return cty.StringVal(v.AsString()), nil
case ty.Equals(cty.Number): case ty.Equals(cty.Number):
return cty.NumberVal(v.AsBigFloat()), nil return cty.NumberVal(v.AsBigFloat()), nil
case ty.Equals(cty.Bool):
return cty.BoolVal(v.True()), nil
default: default:
return cty.NilVal, errors.New("lookup() can only be used with flat lists") return cty.NilVal, errors.New("lookup() can only be used with maps of primitive types")
} }
} }
} }