Skip to content

Cannot nullify values of a subchart template  #11567

@tonyqui

Description

@tonyqui

Greetings helm community,
I'm a bit puzzled about how values are effectively evaluated when a chart references, as its dependency, another chart.

Here's a practical example:

helm template chart/charts/loki-2.12.2.tgz --set securityContext=null

this generates:

securityContext: null

Now, if I create a chart having loki as dependency:

apiVersion: v2
name: aaa
description: aaa
type: application
version: 0.0.1
dependencies:
- name: loki
  version: 2.12.2
  repository: https://grafana.github.io/helm-charts

the helm template command

helm template ./chart/ --set loki.securityContext=null

returns:

        securityContext:
        fsGroup: 10001
        runAsGroup: 10001
        runAsNonRoot: true
        runAsUser: 10001

which are the default values stored into the loki helm chart.

At this stage I am no longer able to nullify the value of securityContext but I could customise the value of each the parameters as follows:

helm template ./chart/ --set loki.securityContext.fsGroup=1 --set loki.securityContext.runAsNonRoot=false

        securityContext:
        fsGroup: 1
        runAsGroup: 10001
        runAsNonRoot: false
        runAsUser: 10001

Can you please review and confirm if this is a bug?

Output of helm version:
version.BuildInfo{Version:"v3.7.0", GitCommit:"eeac83883cb4014fe60267ec6373570374ce770b", GitTreeState:"clean", GoVersion:"go1.16.8"}

Output of kubectl version:
N/A, this happens in local

Cloud Provider/Platform (AKS, GKE, Minikube etc.):
N/A, this happens in local

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions