tanka
tanka copied to clipboard
tk lint problems
Hi,
not really sure if this is a linter problem or if i am still doing sth. wrong (tk show/apply works without a problem).
It seems to have a problem with std.get
.
~> tk --version
tk version v0.22.1
~> tk lint lib/grafana
/tmp/tanka/lib/grafana/grafana-ini.libsonnet:15:26-33 Indexed object has no field "get"
instance_name: std.get(instance, 'name', default='dashboard.' + config.ingress.realm + '.' + config.ingress.tld + '/' + instance.handle),
~> cat /tmp/tanka/lib/grafana/grafana-ini.libsonnet
{
datasourcesFile(config, instance):: {
'datasources.yml': std.manifestYamlDoc(
{
apiVersion: 1,
datasources: instance.datasources,
}
),
},
iniFile(config, instance):: {
'grafana.ini': std.manifestIni(
{
main: {
app_mode: 'production',
instance_name: std.get(instance, 'name', default='dashboard.' + config.ingress.realm + '.' + config.ingress.tld + '/' + instance.handle),
},
....
regards,
strowi
It's an issue upstream. The get
function is new and it's missing from the linter map: https://github.com/google/go-jsonnet/blob/master/linter/internal/types/stdlib.go#L22-L172
Upstream issue: https://github.com/google/go-jsonnet/issues/626 and PR that implements support for it: https://github.com/google/go-jsonnet/pull/627
Fixed with the update to 0.19.1: https://github.com/grafana/tanka/pull/783