Closed semihbkgr closed 9 months ago
provides a way to add common labels and annotations to all objects deployed by the chart
# Labels to add to all deployed objects commonLabels: {} # Annotations to add to all deployed objects commonAnnotations: {}
To merge two maps, we are using merge function. eg:
merge
merge nil .Values.mancenter.ingress.annotations .Values.commonAnnotations
The reason why we are passing nil to the first parameter of merge function is to keep the maps immutable.
nil
$newdict := merge $dest $source1 $source2
The first parameter of the merge function is destination. The new merging entries are put into the destination map.
https://helm.sh/docs/chart_template_guide/function_list/#merge-mustmerge
We are passing nil as a destination map in order to not modify any of our existing map. In this way, the maps generated from the values.yaml and user args are not modified during the render process of templates.
provides a way to add common labels and annotations to all objects deployed by the chart
Implementation Notes
To merge two maps, we are using
merge
function. eg:The reason why we are passing
nil
to the first parameter ofmerge
function is to keep the maps immutable.The first parameter of the
merge
function is destination. The new merging entries are put into the destination map.https://helm.sh/docs/chart_template_guide/function_list/#merge-mustmerge
We are passing
nil
as a destination map in order to not modify any of our existing map. In this way, the maps generated from the values.yaml and user args are not modified during the render process of templates.