Skip to content

deployment.yaml is mutating .Values during template rendering #416

Description

@sparecycles

unset is mutating the .Values object during rendering. This makes rendering order-dependent and non-idempotent. (this is bad practice in general, as a parent chart might consider the securityContext value after .enabled is unset and make a wrong decision.)

{{- $securityContext := unset .Values.initContainers.waitForRedis.securityContext "enabled" }}

and

{{- $securityContext := unset .Values.securityContext "enabled" }}

Looks like this was introduced in #67


Suggestion, apply unset to a clone of the securityContext object, e.g.,

      {{- $securityContext := unset ( .Values.securityContext | deepCopy ) "enabled" }}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions