From 2b74bcc5f3c347ba1c8c8ec3b96e7eba11421b8e Mon Sep 17 00:00:00 2001 From: Ben Lavery-Griffiths Date: Thu, 20 Mar 2025 13:12:52 +0000 Subject: [PATCH] Fix chart_schema.yaml import-values rule 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 --- etc/chart_schema.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etc/chart_schema.yaml b/etc/chart_schema.yaml index 2a26d9ba..e3cd46a8 100644 --- a/etc/chart_schema.yaml +++ b/etc/chart_schema.yaml @@ -29,7 +29,7 @@ dependency: condition: str(required=False) tags: list(str(), required=False) enabled: bool(required=False) - import-values: any(list(str()), list(include('import-value')), required=False) + import-values: list(any(str(), include('import-value')), required=False) alias: str(required=False) --- import-value: