docs: Correct chart name validation rules to match helm lint (DNS-1123 subdomain)#2161
Conversation
helm lint now validates chart names via chartutil.ValidateMetadataName, which permits dots and allows up to 253 characters (DNS-1123 subdomain), not the DNS-1123 label rules (no dots, 63 chars) previously documented. Ref: helm/helm#32278 Signed-off-by: promptless[bot] <promptless[bot]@users.noreply.github.com>
| Chart names must follow DNS-1123 label conventions: only lowercase letters, | ||
| numbers, and dashes are allowed, names must start and end with a lowercase | ||
| letter or number, and names cannot exceed 63 characters: | ||
| Chart names are used as a prefix for the resources a chart creates, so they must |
There was a problem hiding this comment.
PR #32278 makes helm lint call chartutil.ValidateMetadataName on the chart name. Its error message ("use lowercase letters, digits, hyphens, and dots only (e.g. my-chart, my.chart)") and added test cases (valid: my.chart; invalid: MyInvalidChart, my_chart, -my-chart, my-chart-, my chart, ../badchartname) confirmed that dots are now valid, which is why I changed the doc from "Names with dots ... invalid" to listing spaces and path separators as the invalid cases.
Source: helm/helm#32278
| letter or number, and names cannot exceed 63 characters: | ||
| Chart names are used as a prefix for the resources a chart creates, so they must | ||
| be valid Kubernetes resource names. Names must follow DNS-1123 subdomain | ||
| conventions: only lowercase letters, numbers, dashes, and dots are allowed; |
There was a problem hiding this comment.
ValidateMetadataName in validate_name.go enforces the regex ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$ with maxMetadataNameLen = 253. This is the source of the corrected "DNS-1123 subdomain" wording, the per-dot-segment start/end rule, and the 253-character limit replacing the previous 63-character claim.
Source: https://github.com/helm/helm/blob/main/pkg/chart/v2/util/validate_name.go
Open this suggestion in Promptless to view citations and reasoning process
Updates the "Chart Names" best-practices section (v3 and v4 docs) to match the validation helm lint now enforces via chartutil.ValidateMetadataName: dots are allowed (e.g. my.chart), the length limit is 253 characters, and names follow DNS-1123 subdomain (not label) rules. The previous docs incorrectly listed dots as invalid and stated a 63-character limit.
Trigger Events
Tip: Sort by Shortest Review in the Dashboard to find quick wins ⚡