$ cat foo.libsonnet
{
local foo = 99,
bar: [ foo, 101 ]
}
$ cat baz.jsonnet
{
local foo = import 'foo.libsonnet',
baz: [foo.foo, foo.bar]
}
$ jsonnet baz.jsonnet
RUNTIME ERROR: field does not exist: foo
baz.jsonnet:3:11-18 thunk <array_element>
baz.jsonnet:3:10-28 object <anonymous>
During manifestation
In this example, it is easy to access bar
field of foo
. Is there any way for baz.jsonnet
to access the locals of foo.libsonnet
?
If the answer is no, how should I implement foo
and baz
so that I can access the foo
field of foo.libsonnet
in both foo.libsonnet
and also in baz.jsonnet
?