feat(chart): support additionalContainers as a map - #593
Conversation
Allow deployment.additionalContainers to be specified as a map in addition to the existing list format. When a map is provided, each key becomes the container name, which makes per-container overrides easier (e.g. via ArgoCD). The list format remains fully supported and behaves as before. Update values.yaml documentation, the values schema to accept objects, and add unit tests covering both list and map formats, multiple map entries, and the empty-map case. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Signed-off-by: Wilson Júnior <wilsonpjunior@gmail.com>
|
HI @aslafy-z and @rasheedamir what do you think about this MR? |
aslafy-z
left a comment
There was a problem hiding this comment.
Thank you for your contribution, please address the following comment so we can proceed.
|
Could you drop the YAML anchors here and write the asserts out literally? This is test code, and in tests we want to minimize logic and indirection: each test should be readable standalone, as plain input and expected output. Duplication is fine here, an anchor is not worth the extra hop.
Anchors as a convention would only make sense applied consistently across the test files, and I don't think that churn is worth it either way given the point above about keeping tests logic-free. |
|
One more thing on the tests: could you use the placeholder image convention instead of real images ( |
What
Allow
deployment.additionalContainersto be specified as a map in additionto the existing list format. When a map is provided, each key becomes the
container
name; the list format continues to work exactly as before.Why
Map-keyed values are far easier to override and patch per-container in GitOps
tools such as ArgoCD, where merging into a keyed map is deterministic while
merging into a positional list is not. This mirrors the map style already used
elsewhere in the chart (initContainers, envFrom, volumes, ...).
How
map, range the entries and merge (dict "name" $name) $container; for a
list, keep the previous rendering. Empty map/list renders no extra containers.
(list, object, null) so the generated schema validates correctly.
Tests
format (key → name), multiple map entries, and the empty-map case.
format so snapshot tests and Kind API validation exercise the new path.
Rendered output is byte-identical to the list form (snapshots unchanged).
Backwards compatibility
Fully backwards compatible — the list format is unchanged; the map format is
purely additive.