Visitar URL original
Schema validation errors name only the subchart, not its full path, for nested dependencies · Issue #32893 · helm/helm · GitHub
Skip to content

Schema validation errors name only the subchart, not its full path, for nested dependencies #32893

Open

Description

@shimoncohen

What happened?

When a values schema check fails in a nested subchart, the error names only that subchart, not the charts above it:

Error: values don't meet the specifications of the schema(s) in the following chart(s):
leaf:
- at '': missing property 'owner'

This is a problem when a common library chart (for example, one that adds standard labels) is a dependency of many subcharts in an umbrella chart. Every failure reads leaf:, so you can't tell which subchart has the bad values. The --debug log doesn't help either, because it also uses the short name.

What did you expect to happen?

The error should name the full chart path, in the same top/charts/mid/charts/leaf form that Helm already prints for template errors:

top/charts/mid/charts/leaf:
- at '': missing property 'owner'

How can we reproduce it (as minimally and precisely as possible)?

mkdir -p top/charts/mid/charts/leaf
printf 'apiVersion: v2\nname: top\nversion: 0.1.0\n' > top/Chart.yaml
printf 'apiVersion: v2\nname: mid\nversion: 0.1.0\n' > top/charts/mid/Chart.yaml
printf 'leaf:\n  name: x\n' > top/charts/mid/values.yaml
printf 'apiVersion: v2\nname: leaf\nversion: 0.1.0\ntype: library\n' > top/charts/mid/charts/leaf/Chart.yaml
printf '{"type":"object","required":["owner"]}\n' > top/charts/mid/charts/leaf/values.schema.json
helm template top

The error names leaf: instead of top/charts/mid/charts/leaf:.

The cause is in ValidateAgainstSchema (pkg/chart/common/util/jsonschema.go). It writes chrt.Name() for each chart it validates. ChartFullPath() is already on the chart accessor and would give the full path. I have a fix with tests ready and will open a PR.

Helm version

v4.3.0+gbec5b06

The same code is on main.

Kubernetes version

Not relevant: helm template reproduces it without a cluster.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions