{"record":{"id":"311b95dd3129cb8e","repo":"helm/helm","slug":"chart-name-q-is-invalid","errorCode":null,"errorMessage":"chart name %q is invalid","messagePattern":"chart name %q is invalid","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"internal/chart/v3/lint/rules/chartfile.go","lineNumber":121,"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 \\\"v3\\\"\")\n\t}\n\n\tif cf.APIVersion != chart.APIVersionV3 {\n\t\treturn fmt.Errorf(\"apiVersion '%s' is not valid. The value must be \\\"v3\\\"\", cf.APIVersion)\n\t}\n\n\treturn nil\n}\n\nfunc validateChartVersion(cf *chart.Metadata) error {\n\tif cf.Version == \"\" {","sourceCodeStart":103,"sourceCodeEnd":139,"githubUrl":"https://github.com/helm/helm/blob/2a29f1770b62844b27197d2507377361d45ad7c0/internal/chart/v3/lint/rules/chartfile.go#L103-L139","documentation":"validateChartName (internal/chart/v3/lint/rules/chartfile.go:121) rejects a chart name that is not equal to its own filepath.Base — i.e. the name contains path separators ('foo/bar') or other characters that make Base(name) differ from name. Empty names are caught earlier by the separate 'name is required' error.","triggerScenarios":"`name: acme/mychart` in Chart.yaml; names containing slashes, or NUL/trailing-slash-like sequences that change the base name; names built by joining an org prefix with the chart name.","commonSituations":"Trying to namespace a chart like a Go module or docker image (acme/mychart); converting from formats where slashed names are conventional; script-generated names concatenating directory paths.","solutions":["Use a plain, slash-free name: `name: mychart`","If namespacing is needed, encode it differently (prefix with a dash: acme-mychart) since OCI refs carry the path part at push time","Validate with `helm lint` before publishing"],"exampleFix":"# before\nname: acme/mychart\n# after\nname: acme-mychart","handlingStrategy":"validation","validationCode":"if md.Name != filepath.Base(md.Name) || strings.ContainsAny(md.Name, \"/\\\\\") {\n    return fmt.Errorf(\"chart name %q must not contain path separators\", md.Name)\n}","typeGuard":"func isValidChartName(name string) bool {\n    return name != \"\" && name == filepath.Base(name)\n}","tryCatchPattern":"// Lint-time message: on 'chart name ... is invalid', rename the chart in\n// Chart.yaml to a slash-free name and bump dependent aliases/references.","preventionTips":["Never namespace chart names with slashes; the registry path carries namespacing","Validate names with filepath.Base equality in chart scaffolding tools","Check dependent charts' aliases when renaming, since references break"],"tags":["lint","chart","naming","validation"],"backgroundTag":null,"analyzedSha":"2a29f1770b62844b27197d2507377361d45ad7c0","analyzedAt":"2026-08-15T22:02:47.490Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}