docs: Clarify how alias interacts with dependency conditions and tags#2183
docs: Clarify how alias interacts with dependency conditions and tags#2183promptless-for-oss wants to merge 1 commit into
Conversation
Document that when a chart dependency uses an alias, its condition path and enabling values in the top parent's values must be keyed by the alias name, that nested aliased chains accumulate the alias at each level, and that tags are matched by their labels rather than the alias name. Applied to both the version-3 and next (v4) charts guide. Signed-off-by: promptless[bot] <promptless[bot]@users.noreply.github.com>
| The manual way of achieving this is by copy/pasting the same chart in the | ||
| `charts/` directory multiple times with different names. | ||
|
|
||
| When a dependency uses an `alias`, the alias becomes the dependency's name for |
There was a problem hiding this comment.
Verifies that an alias becomes the dependency's name for condition evaluation. In processDependencyEnabled, if req.Alias != "" { req.Name = req.Alias } (lines 165-166) runs before processDependencyConditions (defined line 40), which resolves cvals.PathValue(cpath + c) (line 47) against the user-defined condition path. Confirmed by testdata/subpop/Chart.yaml where the dependency name=subchart2, alias=subchart2alias uses condition: subchart2alias.enabled.
Source: https://github.com/helm/helm/blob/main/pkg/chart/v2/util/dependencies.go#L165-L166
| enabled: true | ||
| ``` | ||
|
|
||
| For a chart reached through an aliased dependency chain, the values path |
There was a problem hiding this comment.
Verifies that the values path accumulates the alias name at each level of an aliased dependency chain. Recursion builds subpath := path + t.Metadata.Name + "." (line 205); getAliasDependency sets the copied chart's out.Metadata.Name = dep.Alias, so the metadata name equals the alias, producing paths like outer-alias.inner-alias.enabled.
Source: https://github.com/helm/helm/blob/main/pkg/chart/v2/util/dependencies.go#L205
|
|
||
| For a chart reached through an aliased dependency chain, the values path | ||
| accumulates the alias name at each level (for example, | ||
| `outer-alias.inner-alias.enabled`). Tags are not affected by an alias: they are |
There was a problem hiding this comment.
Verifies that tags are not affected by an alias. processDependencyTags (defined line 64) reads the "tags" values table via cvals.Table("tags") (line 69) and matches each dependency's r.Tags labels against vt[k]; the dependency name (r.Name) is used only in a non-bool warning log message, never for tag matching.
Source: https://github.com/helm/helm/blob/main/pkg/chart/v2/util/dependencies.go#L64-L69
| The manual way of achieving this is by copy/pasting the same chart in the | ||
| `charts/` directory multiple times with different names. | ||
|
|
||
| When a dependency uses an `alias`, the alias becomes the dependency's name for |
There was a problem hiding this comment.
Mirror of docs/topics/charts.mdx alias-condition note. Verifies alias becomes the dependency's name for condition evaluation: if req.Alias != "" { req.Name = req.Alias } (lines 165-166) runs before processDependencyConditions (line 40); condition path resolved via cvals.PathValue(cpath + c) (line 47). Confirmed by testdata/subpop/Chart.yaml (name=subchart2, alias=subchart2alias, condition: subchart2alias.enabled).
Source: https://github.com/helm/helm/blob/main/pkg/chart/v2/util/dependencies.go#L165-L166
| enabled: true | ||
| ``` | ||
|
|
||
| For a chart reached through an aliased dependency chain, the values path |
There was a problem hiding this comment.
Mirror of docs/topics/charts.mdx. Verifies values path accumulates the alias at each level: recursion builds subpath := path + t.Metadata.Name + "." (line 205) and getAliasDependency sets out.Metadata.Name = dep.Alias. Also verifies tags unaffected by alias via processDependencyTags reading cvals.Table("tags").
Source: https://github.com/helm/helm/blob/main/pkg/chart/v2/util/dependencies.go#L205
| - Tags and conditions values must be set in the top parent's values. | ||
| - The `tags:` key in values must be a top level key. Globals and nested `tags:` | ||
| tables are not currently supported. | ||
| - When a dependency uses an `alias`, its `condition` path is keyed by the alias |
There was a problem hiding this comment.
Verifies the Tags and Condition Resolution bullet: an aliased dependency's condition path is keyed by the alias (req.Name = req.Alias at lines 165-166 before processDependencyConditions), and tags are matched by r.Tags labels against the "tags" table (processDependencyTags, lines 64-69), not by chart/alias name.
Source: https://github.com/helm/helm/blob/main/pkg/chart/v2/util/dependencies.go#L165-L166
| - Tags and conditions values must be set in the top parent's values. | ||
| - The `tags:` key in values must be a top level key. Globals and nested `tags:` | ||
| tables are not currently supported. | ||
| - When a dependency uses an `alias`, its `condition` path is keyed by the alias |
There was a problem hiding this comment.
Mirror of docs/topics/charts.mdx Tags and Condition Resolution bullet. Verifies aliased dependency's condition path is keyed by the alias (req.Name = req.Alias, lines 165-166, before processDependencyConditions) and tags are matched by r.Tags labels against the "tags" table (processDependencyTags, lines 64-69), not by chart/alias name.
Source: https://github.com/helm/helm/blob/main/pkg/chart/v2/util/dependencies.go#L165-L166
Open this suggestion in Promptless to view citations and reasoning process
Documents the interaction between a dependency
aliasand thecondition/tagsfields in the chart dependencies guide. Adds a note to the "Alias field in dependencies" section and a bullet to the "Tags and Condition Resolution" list explaining that when a dependency uses an alias, itsconditionpath and enabling values in the top parent's values must be keyed by the alias name (not the original chart name); that a chart reached through an aliased dependency chain accumulates the alias name at each level of the values path; and thattagsare matched by their declared labels and are unaffected by aliasing. Applied identically todocs/topics/charts.mdx(v4/next) andversioned_docs/version-3/topics/charts.md(released v3). Claims verified against helm/helm dependency-processing source.Trigger Events
Tip: Enable auto-create PR in your Configuration to review suggestions directly in GitHub 🤖