Radek Simko
b41cda7d7a
Return cty.DynamicPseudoType instead
2018-10-23 12:42:46 +02:00
Radek Simko
4856d81300
lang: Fix crash in lookup function
2018-10-22 12:58:47 +02:00
James Bardin
9e3c23d890
verify that all LengthInt calls are known
...
There were some funcs with LengthInt calls on unknown values
2018-10-18 19:19:59 -04:00
Kristin Laemmert
fd77e56fd6
lookup will return a tuple type when passed an object
2018-10-16 19:14:54 -07:00
Kristin Laemmert
f54ee830d3
lang/funcs: update values to accept object types
2018-10-16 19:14:54 -07:00
Kristin Laemmert
4ec904bca7
funcs/lang lookup: validate that argument is map or object type
2018-10-16 19:14:54 -07:00
Kristin Laemmert
d1d0ede069
lang/funcs: return default value if provided when object lookup fails to find attr
2018-10-16 19:14:54 -07:00
Kristin Laemmert
46e168a682
lang/funcs: update lookup() to accept object-typed values for "map" arg
2018-10-16 19:14:54 -07:00
Martin Atkins
c990c9f36d
lang/funcs: Don't panic if coalescelist gets an unknown list
2018-10-16 19:14:11 -07:00
Martin Atkins
db58b88c2d
lang/funcs: short-circuit with unknown index and tuple collection
...
Since we need to know the index to know the result type for a tuple, we
need a special case here to deal with that situation and return
cty.DynamicVal; we can't predict the result type exactly until we know the
element type.
2018-10-16 19:14:11 -07:00
Kristin Laemmert
c23a971ed1
minor fixes
2018-10-16 18:49:20 -07:00
Kristin Laemmert
0dbecc54c0
functions: ValuesFunc - cleanup return type
2018-10-16 18:49:20 -07:00
Kristin Laemmert
a213c4a648
functions: add tests and support for unknown values
2018-10-16 18:49:20 -07:00
Kristin Laemmert
d802d5c624
functions: pr feedback fixes
2018-10-16 18:49:20 -07:00
Kristin Laemmert
ff4b3d763b
functions: fix lookup()'s handling of numberical defaults
2018-10-16 18:49:20 -07:00
Kristin Laemmert
4f5c03339a
functions: ZipmapFunc
2018-10-16 18:49:20 -07:00
Kristin Laemmert
605e23db6b
various code review fixes
2018-10-16 18:49:20 -07:00
Kristin Laemmert
6463dd90e9
functions: TransposeFunc, SliceFunc
2018-10-16 18:49:20 -07:00
Kristin Laemmert
30671d85ad
functions: MergeFunc
2018-10-16 18:49:20 -07:00
Kristin Laemmert
aecd7b2e62
functions: LookupFunc
2018-10-16 18:49:20 -07:00
Kristin Laemmert
4d8c398f8e
functions: KeysFunc
2018-10-16 18:49:20 -07:00
Kristin Laemmert
21daabe680
functions: MapFunc
2018-10-16 18:49:20 -07:00
Kristin Laemmert
da02e0da4d
functions: ListFunc
2018-10-16 18:49:20 -07:00
Kristin Laemmert
529c2c3cc9
functions: FlattenFunc
2018-10-16 18:49:20 -07:00
Kristin Laemmert
4dd3ffc127
porting matchkeys
2018-10-16 18:49:20 -07:00
Kristin Laemmert
b979053361
general cleanup - addressing code review
2018-10-16 18:49:20 -07:00
Kristin Laemmert
498ffbf77b
adding some test cases and tweaking implementation to address them
2018-10-16 18:49:20 -07:00
Kristin Laemmert
0cbcd75ebb
port distinct and chunklist functions
2018-10-16 18:49:20 -07:00
Kristin Laemmert
8aac7587f7
port index and contains functions
2018-10-16 18:49:20 -07:00
Kristin Laemmert
e697e7d733
port compact function
2018-10-16 18:49:20 -07:00
Kristin Laemmert
1901d5d184
port coalescelist function
2018-10-16 18:49:20 -07:00
Kristin Laemmert
04ac87747c
base64decode: check that the decoded (not encoded) string is valid UTF-8
2018-10-16 18:49:20 -07:00
Martin Atkins
129f5fe74d
lang/funcs: port some of Terraform's built-in functions
...
These implementations are adaptations of the existing implementations in
config/interpolate_funcs.go, updated to work with the cty API.
The set of functions chosen here was motivated mainly by what Terraform's
existing context tests depend on, so we can get the contexts tests back
into good shape before fleshing out the rest of these functions.
2018-10-16 18:48:28 -07:00