SAP-archive / ytt-lint

ytt lint validates ytt-templates and plain yaml-files. It is designed for Kubernetes artifacts, but works with other yaml-files.
Apache License 2.0
11 stars 2 forks source link

Type issues mismatches with `magic` #22

Open qnp opened 1 year ago

qnp commented 1 year ago

Hello there,

I have a lot of issues that involve a "magic" type that cannot match other type. For instance:

regexp.match: expected starlark.String, but was *magic.MagicType
magic index: got magic, want int
.spec.template.spec.containers[0].resources expected object got: magic

I have ytt lint v0.3.1.

Below is an example file that generates the error magic index: got magic, want int:

#@ load("@ytt:data", "data")
#@ load("@ytt:struct", "struct")
---
#@ for key in struct.decode(data.values.env):
  - name: #@ key
    value: #@ "{}".format(data.values.env[key])
#@ end

Capture d’écran 2023-01-26 à 13 57 44

Is there something that I am doing wrong or is it a bug of the linter ?

Best regards

blakebarnett commented 8 months ago

Seeing this quite a bit also: Screenshot 2023-11-08 at 12 30 43 PM