-
Notifications
You must be signed in to change notification settings - Fork 568
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Environment values not overriding #1168
Comments
@michaelajr Hey! I couldn't reproduce your issue with the following example:
Could you clarify a bit more? We did fix a bug that you couldn't override a value if it was nil as per #1153 and #1162. Would it affect your use-case? |
Hi. Thanks for the quick response. Here's our real world example.
$ tail -20 *
==> addons.yaml <==
addons:
mychart:
skip: true
name: mychart
namespace: kube-system
chart: stable/mychart
version: 1.0.0
==> addons2.yaml <==
addons:
mychart:
skip: false
==> helmfile.yaml <==
environments:
default:
missingFileHandler: Error
values:
- addons.yaml
- addons2.yaml
releases:
{{- range .Values.addons }}
{{- if not .skip }}
- name: {{ .name }}
namespace: {{ .namespace }}
chart: {{ .chart }}
version: {{ .version }}
{{- end }}
{{- end }} In this example $ helmfile build
---
# Source: helmfile.yaml
filepath: helmfile.yaml
helmBinary: helm
environments:
default:
values:
- addons.yaml
- addons2.yaml
missingFileHandler: Error
templates: {}
err: no releases found that matches specified selector() and environment(default), in any helmfile Now, let's NOT skip the chart in ==> addons.yaml <==
addons:
mychart:
skip: false
name: mychart
namespace: kube-system
chart: stable/mychart
version: 1.0.0 And build $ helmfile build
---
# Source: helmfile.yaml
filepath: helmfile.yaml
helmBinary: helm
environments:
default:
values:
- addons.yaml
- addons2.yaml
missingFileHandler: Error
releases:
- chart: stable/mychart
version: 1.0.0
name: mychart
namespace: kube-system There it is. So Also, if a file does not exist, I no longer get an error that stops the build. $ tail -20 helmfile.yaml
environments:
default:
missingFileHandler: Error
values:
- does-not-exist.yaml
- addons.yaml
- addons2.yaml
releases:
{{- range .Values.addons }}
{{- if not .skip }}
- name: {{ .name }}
namespace: {{ .namespace }}
chart: {{ .chart }}
version: {{ .version }}
{{- end }}
{{- end }} Build. $ helmfile build
in ./helmfile.yaml: error during helmfile.yaml.part.0 parsing: template: stringTemplate:9:17: executing "stringTemplate" at <.Values.addons>: map has no entry for key "addons It looks like it fails internally but continues with no values , so it fails later. Pretty sure I use to get a Btw, thanks for your work on this. Been following the repo, and you put in a lot of time. Great in depth comments - quick responses and turn arounds. So thank you. Really appreciate it. M |
Looks like other non-boolean values do override. Changing versions in this example, and it does work.
|
Also, can confirm |
Also here is confirmation that the boolean merge worked in
|
Thanks a lot for your detailed report! It does seem like a regression - So in nutshell it seems like an override with a zero values(like Probably we need to revert a change or two regarding |
It does seem something in the |
@michaelajr I managed to reproduce and fix this thanks to you and @elodani, in #1169. Could you please confirm if it works for you now with Helmfile v1.106.4? |
Also - I've added a few tests to make this never happen again :) See #1170 |
The same problem exists with mergeOverwrite:
build output (helmfile version v0.126.0)
in mo1 only |
I meant v0.106.4 |
@jalkjaer FWIW it seems a sprig issue. Sprig's
|
Latest version (v3.1.0) of sprig does the expected. (see https://play.golang.org/p/r_IgI3Tqb1A ) But those deps cause a test to fail
That test is rather daunting (for a go / Helmfile noob like me) so this is as far I was able to get. |
@jalkjaer Thanks for trying. Would u mind submitting the PR so that I can review and see what's going on? |
PR #1456 created |
Something has broken in the last release around env values. I use to be able to do this:
Where
values-file-2.yaml
had some values that would override values invalues-file-1.yaml
. This is no longer working. It appearsvalues-file-2.yaml
is ignored (although I am not sure). It only has a single value override.Also
missingFileHandler: Error
no longer works. It will not error on missing files.Sorry if I missed a post about a breaking change. But I'm going to downgrade until this is resolved or I understand the issue.
The text was updated successfully, but these errors were encountered: