You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
k8s WK8102 prints [object Object] for a manifest whose metadata.name is not a string #5110
chant audit reads a template file that holds name: {{name}} as a Kubernetes manifest. YAML parses {{name}} as a flow mapping whose key is another mapping, so metadata.name is an object. WK8102 then reports Namespace "[object Object]" has no metadata.labels, and the finding's entity in the JSON report is the object {"[object Object]": null} where the report model expects a string. The file on kubernetes/k8s.io is infra/gcp/bash/namespaces/namespace.yml, a template a shell script fills in.
chant audit tree --format json --tier all --fail-on none -o out.json
The report holds one finding: checkIdWK8102, entity{"[object Object]": null}, message starting Namespace "[object Object]" has no metadata.labels.
Expected
A document whose metadata.name is not a string is not read as a named object. The audit skips it with a notice naming the file (a template placeholder is the common cause), or reports it under the file with no entity. Every finding's entity in the JSON report is a string or absent. No message prints [object Object].
Where
lexicons/k8s/src/lint/post-synth/wk8102.ts (manifest.metadata.name ?? manifest.kind, with no type check; it is the only post-synth rule in the k8s lexicon with that fallback). The same unchecked cast is in parseDocument in lexicons/k8s/src/import/parser.ts (metadata.name as string | undefined).
Found while reading kubernetes/k8s.io offline, for #5067. Tracked on #5105.
Activity
fix(k8s): lint rules print a metadata.name that is not a string witho…
feat: estate-read batch 3, Terraform and k8s lint precision, Helm ren…