Skip to content

Moglum/helmfile-arrays

Repository files navigation

Array merging/replacing

The output of the commands below is simplifed to only show the templating output

Expected behavior

With helmfile v1.2.3

❯ helmfile version

▓▓▓ helmfile

  Version            1.2.3
  Git Commit         61f4a31
  Build Date         20 Dec 25 02:24 CET (3 months ago)
  Commit Date        20 Dec 25 02:08 CET (3 months ago)
  Dirty Build        no
  Go version         1.25.4
  Compiler           gc
  Platform           linux/amd64

> helmfile template --file helmfile.yaml
---
item: first
item: second

❯ helmfile template --file helmfile.yaml --state-values-file values-first.yaml
---
item: first

❯ helmfile template --file helmfile.yaml --state-values-file values-second.yaml
---
item: second

❯ helmfile template --file helmfile.yaml --state-values-file values-third.yaml
---
item: third

The single item arrays passed via --state-values-file values-*.yaml completely override the array in values-default.yaml

Strange behavior

Tested with

  • 1.3.0
  • 1.4.2
  • 1.4.4
❯ helmfile version

▓▓▓ helmfile

  Version            v1.4.4
  Git Commit         "brew"
  Build Date         08 Apr 26 02:25 CEST (2 days ago)
  Commit Date        08 Apr 26 02:25 CEST (2 days ago)
  Dirty Build        no
  Go version         1.26.2
  Compiler           gc
  Platform           linux/amd64

> helmfile template --file helmfile.yaml
---
item: first
item: second

❯ helmfile template --file helmfile.yaml --state-values-file values-first.yaml
---
item: first
item: second

❯ helmfile template --file helmfile.yaml --state-values-file values-second.yaml
---
item: second
item: second

❯ helmfile template --file helmfile.yaml --state-values-file values-third.yaml
---
item: third
item: second

The arrays are merged based on the order of the elements.

About

Sample helmfile to demonstrate a possible bug

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors