From 8b5d094f1968a54d491bb8fe15f5340b73b6899a Mon Sep 17 00:00:00 2001 From: Benoit Tigeot Date: Wed, 25 Feb 2026 01:17:28 +0100 Subject: [PATCH] fix(schema): enable $ref resolution for directory charts Set ChartDir only for directory-based charts to enable $ref resolution in JSON schemas. Archived charts (.tgz) are loaded into memory without filesystem extraction, so $ref resolution is not supported for them. This fixes the original issue where `helm template .` and `helm install .` failed to validate schemas with relative $ref references. Fixes #31260 Signed-off-by: Benoit Tigeot --- pkg/chart/common/util/jsonschema.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/chart/common/util/jsonschema.go b/pkg/chart/common/util/jsonschema.go index 752184c7d..94a3171d1 100644 --- a/pkg/chart/common/util/jsonschema.go +++ b/pkg/chart/common/util/jsonschema.go @@ -84,6 +84,9 @@ func ValidateAgainstSchemaWithPath(ch chart.Charter, values map[string]any, char return err } + // Convert chartDir to absolute path for $ref resolution. + // If chartDir is empty (e.g., chart loaded from .tgz archive), absChartPath + // remains empty and a synthetic path will be used instead. var absChartPath string if chartDir != "" { var err error