1
0
mirror of https://github.com/helm/chart-testing.git synced 2026-02-05 18:45:18 +01:00
Files
chart-testing/etc
Ben Lavery-Griffiths 5b4fb1a4cf Fix chart_schema.yaml import-values rule (#725)
The existing rule for validating dependency import-values worked well for either of these two cases:

**1. Importing exports**

```yaml
dependencies:
- name: dep1
  version: 0.14.1
  repository: oci://myrepo
  import-values:
    - data
```

**2. Importing child values into the parent**

```yaml
dependencies:
- name: dep1
  version: 0.14.1
  repository: oci://myrepo
  import-values:
    - child: default.data
      parent: myimports
```

However, it failed on the following valid usecase:

```yaml
dependencies:
- name: dep1
  version: 0.14.1
  repository: oci://myrepo
  import-values:
    - data
    - child: default.data
      parent: myimports
```

Giving the following error:

```
dependencies.0.import-values.1: '{'parent': 'myimports', 'child': 'default.data'}' is not a str.
dependencies.0.import-values.0 : 'data' is not a map
```

This is because the Yamale is validating on a list of strings *or* a list of `import-value`, where a list containing both is also valid.

This commit changes the rule to allow both methods to be in the `import-values` list.

Signed-off-by: Ben Lavery-Griffiths <ben@lavery-griffiths.com>
2025-06-02 10:40:03 +02:00
..