From 6a2d9a8695cc49aac74d8ed207c8848b9cbb5ad2 Mon Sep 17 00:00:00 2001 From: Benoit Tigeot Date: Sun, 22 Feb 2026 14:48:07 +0100 Subject: [PATCH] fix: handle dynamic schema paths in error message trimming The error message trimming logic was hardcoded to remove the prefix "jsonschema validation failed with 'file:///values.schema.json#'", which broke when we switched to using absolute paths for $ref resolution. Signed-off-by: Benoit Tigeot --- pkg/chart/common/util/jsonschema.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pkg/chart/common/util/jsonschema.go b/pkg/chart/common/util/jsonschema.go index e34691f7d..38ec632ae 100644 --- a/pkg/chart/common/util/jsonschema.go +++ b/pkg/chart/common/util/jsonschema.go @@ -236,7 +236,12 @@ func (e JSONSchemaValidationError) Error() string { // This string prefixes all of our error details. Further up the stack of helm error message // building more detail is provided to users. This is removed. - errStr = strings.TrimPrefix(errStr, "jsonschema validation failed with 'file:///values.schema.json#'\n") + // Remove the "jsonschema validation failed with 'file://...#'" line regardless of the path + if strings.HasPrefix(errStr, "jsonschema validation failed with 'file://") { + if idx := strings.Index(errStr, "#'\n"); idx != -1 { + errStr = errStr[idx+3:] // Skip past "#'\n" + } + } // The extra new line is needed for when there are sub-charts. return errStr + "\n"