{"record":{"id":"a74387f11de4edd2","repo":"helm/helm","slug":"chart-name-q-is-invalid-a74387","errorCode":null,"errorMessage":"chart name %q is invalid","messagePattern":"chart name %q is invalid","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/chart/v2/lint/rules/chartfile.go","lineNumber":122,"sourceCode":"\t\treturn fmt.Errorf(\"unable to parse YAML\\n\\t%w\", chartFileError)\n\t}\n\treturn nil\n}\n\nfunc validateChartYamlStrictFormat(chartFileError error) error {\n\tif chartFileError != nil {\n\t\treturn fmt.Errorf(\"failed to strictly parse chart metadata file\\n\\t%w\", chartFileError)\n\t}\n\treturn nil\n}\n\nfunc validateChartName(cf *chart.Metadata) error {\n\tif cf.Name == \"\" {\n\t\treturn errors.New(\"name is required\")\n\t}\n\tname := filepath.Base(cf.Name)\n\tif name != cf.Name {\n\t\treturn fmt.Errorf(\"chart name %q is invalid\", cf.Name)\n\t}\n\treturn nil\n}\n\nfunc validateChartAPIVersion(cf *chart.Metadata) error {\n\tif cf.APIVersion == \"\" {\n\t\treturn errors.New(\"apiVersion is required. The value must be either \\\"v1\\\" or \\\"v2\\\"\")\n\t}\n\n\tif cf.APIVersion != chart.APIVersionV1 && cf.APIVersion != chart.APIVersionV2 {\n\t\treturn fmt.Errorf(\"apiVersion '%s' is not valid. The value must be either \\\"v1\\\" or \\\"v2\\\"\", cf.APIVersion)\n\t}\n\n\treturn nil\n}\n\nfunc validateChartVersion(cf *chart.Metadata) error {\n\tif cf.Version == \"\" {","sourceCodeStart":104,"sourceCodeEnd":140,"githubUrl":"https://github.com/helm/helm/blob/2a29f1770b62844b27197d2507377361d45ad7c0/pkg/chart/v2/lint/rules/chartfile.go#L104-L140","documentation":"Lint rule validating the metadata name: filepath.Base(cf.Name) must equal cf.Name, i.e. the chart name must be a single path element with no separators and no '..' tricks. 'foo/bar' fails because Base is 'bar'. Reported at ErrorSev.","triggerScenarios":"Chart.yaml with `name: my-org/mychart`, `name: ./mychart`, `name: charts/backend`, or a name containing an OS path separator. Also note the empty-name case has its own 'name is required' error before this check.","commonSituations":"Wanting a 'grouped' chart name resembling an OCI repository path; scaffolding scripts injecting paths; porting charts from ecosystems where scoped names are allowed (npm style).","solutions":["Use a flat name: `name: mychart`.","Put organization/repo scoping in the repository or OCI reference (oci://registry/myorg/mychart), not in metadata.name.","Ensure the directory name matches the chart name as Helm convention expects."],"exampleFix":"# before\napiVersion: v2\nname: my-org/mychart   # -> chart name \"my-org/mychart\" is invalid\n\n# after\napiVersion: v2\nname: mychart          # scope lives in the repo/OCI path, not the name","handlingStrategy":"validation","validationCode":"// Enforce a flat chart name before publish\nif filepath.Base(md.Name) != md.Name || md.Name == \"\" {\n\treturn fmt.Errorf(\"chart name %q must be a single path element\", md.Name)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep metadata.name equal to the chart directory name.","Encode organization scoping in the repository/OCI reference, not the name."],"tags":["helm","lint","chart-yaml","name","path-validation"],"backgroundTag":null,"analyzedSha":"2a29f1770b62844b27197d2507377361d45ad7c0","analyzedAt":"2026-08-15T22:02:47.490Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}