Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lookup/lookup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -468,9 +468,9 @@ func TestLookup_all_not_there(t *testing.T) {
func TestLookup_all_type(t *testing.T) {
ensureTestPlugin(t)
inTestdata(func() {
result, err := cli.ExecuteLookup(`stringkey`, `intkey`, `--all`, `--dialect`, `dgo`, `--render-as`, `s`, `--type`, `{"stringkey":string,"intkey":int}`)
result, err := cli.ExecuteLookup(`stringkey`, `intkey`, `literalkey`, `--all`, `--dialect`, `dgo`, `--render-as`, `s`, `--type`, `{"stringkey":string,"literalkey":string,"intkey":int}`)
require.NoError(t, err)
require.Equal(t, `{"stringkey":"stringvalue","intkey":1}
require.Equal(t, `{"stringkey":"stringvalue","intkey":1,"literalkey":"%{literalvalue}"}
`, string(result))
})
}
Expand Down
2 changes: 2 additions & 0 deletions lookup/testdata/hiera/common.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,6 @@ simple: value

stringkey: stringvalue

literalkey: "%{literal('%')}{literalvalue}"

intkey: 1
1 change: 0 additions & 1 deletion session/invocation.go
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,6 @@ func (ic *ivContext) Lookup(key api.Key, options dgo.Map) dgo.Value {
v := ic.TopProvider()(ic.ServerContext(options), rootKey)
if v != nil {
dc := ic.ForData()
v = dc.Interpolate(v, true)
v = key.Dig(dc, v)
}
return v
Expand Down