quintush / helm-unittest

BDD styled unit test framework for Kubernetes Helm charts as a Helm plugin.
MIT License
345 stars 69 forks source link

Is it possible to set values from sub-chart into top level chart? #110

Closed andriisoldatenko closed 1 year ago

andriisoldatenko commented 3 years ago

I have example: from https://github.com/astronomer/astronomer/blob/master/values.yaml#L6

is it possible to overide global.baseDomain value from grafana sub-chart/sub-folder https://github.com/astronomer/astronomer/tree/master/charts/grafana:

---
suite: Test ingress
templates:
  - ingress.yaml
tests:
  - it: should work
       set:
         global.baseDomain: test
    asserts:
      - isKind:
          of: Ingress
quintush commented 3 years ago

Hello @andriisoldatenko,

Yes it is possible to override values from subcharts and global values are always overridable as they have only one value within the whole chart, including charts in subfolders or dependant charts.

When you set values for subcharts, it is also helpfull to validate the outcome. Within the documentation, there is a section on testing subcharts.

Greetings, @quintush