splunk / qbec

configure kubernetes objects on multiple clusters using jsonnet

Home Page:https://qbec.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

qbec fmt panics on malformed jsonnet string

harsimranmaan opened this issue · comments

echo "{a : '^/v1/abc-[\w-.]+/xyz/[\w-.]+$'}" > a.jsonnet
qbec fmt a.jsonnet
qbec fmt  a.jsonnet
panic: Badly formatted string, should have been caught in lexer.

goroutine 1 [running]:
github.com/google/go-jsonnet/internal/formatter.(*EnforceStringStyle).LiteralString(0xc0001d38f0, {0x265b158, 0xc0001d38f0}, 0xc0001df080, {0x0, 0x0})
	/home/runner/go/pkg/mod/github.com/google/go-jsonnet@v0.18.0/internal/formatter/enforce_string_style.go:45 +0x17b
github.com/google/go-jsonnet/internal/pass.(*Base).Visit(0xc000138190, {0x265b158, 0xc0001d38f0}, 0xc000138170, {0x0, 0x0})
	/home/runner/go/pkg/mod/github.com/google/go-jsonnet@v0.18.0/internal/pass/pass.go:433 +0x24c
github.com/google/go-jsonnet/internal/pass.(*Base).ObjectField(0xc0001380f0, {0x265b158, 0xc0001d38f0}, 0xc0001380f0, {0x0, 0x0})
	/home/runner/go/pkg/mod/github.com/google/go-jsonnet@v0.18.0/internal/pass/pass.go:162 +0xdd

Expected graceful failure. Might need patching jsonnet upstream or panic recovery in formatter