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
Nested null
values don't remove keys as expected
#5184
Comments
@scottrigby, do you by any chance want to take a gander at this one? |
Marking as question/support until it's been confirmed that this is indeed a bug according to the original author. |
I'm seeing this as well on 2.12.3. I'm seeing while trying to set the value to null via both -f and --set. Either way it just sets it to "null" as a string (without the quotes) rather than removing the default value.
Use case is to reset these values to use the defaults from the template instead of the defaults now stuck in helm. |
stable/filebeat With ---values.yml in the Chart
output.file:
path: /var/log/foo.log ---my overrides
output.elasticsearch:
hosts:
- 'http://localhost:9200'
output.file: null or ---my overrides
output:
elasticsearch:
host:
- 'http://localhost:9200'
file: null or ---my overrides
output:
elasticsearch:
hosts:
- 'http://localhost:9200'
output.file: null
pod errors as:
|
I'm also encountering this exact issue with the filebeat chart. @cdenneen You can get around file output specifically with I'm encountering an issue where I want to use the new Existing values:
My override: Result: (config is used to set a Secret value)
|
I also encountered this problem with |
@aeijdenberg believe your PR just requires labels updated to be reviewed |
Hey @bacongobbler sorry I missed your question in #5184 (comment). I can verify it is a bug. In #2648 I really should have added a test that matched the documented example. I had meant to get back to this but #5185 looks promising! 👏 will respond over there |
Hi @scottrigby . May I know which release will include #5185's fix? I just encountered this problem when trying to remove resources definitions on istio chart. |
This is supposed to be in 2.14.2 - but I can't get it to work. I'm following a very similar example to that at the top of the issue - the only difference I can see is that I'm trying to delete a value set in a subchart (in my case, logstash). I have tried:
Have I misunderstood and this didn't make it into 2.14.2 - or is there still an issue? (Chart demonstrating this: demo.zip) |
The patch was cherry-picked into 2.14.2 according to the release notes so it should be available. |
In which case, I'm not sure this bug is fixed - should it be re-opened or a new issue created? Can someone else have a look at the chart I attached to the above and see if they see different? |
@cc-stjm @bacongobbler - I am able to reproduce the issue, and I think this test demonstrates it: func TestSubchartCoaleseWithNullValue(t *testing.T) {
v, err := CoalesceValues(&chart.Chart{
Metadata: &chart.Metadata{Name: "demo"},
Dependencies: []*chart.Chart{
{
Metadata: &chart.Metadata{Name: "logstash"},
Values: &chart.Config{
Raw: `livenessProbe: {httpGet: {path: "/", port: monitor}}`,
},
},
},
Values: &chart.Config{
Raw: `logstash: {livenessProbe: {httpGet: null, exec: "/bin/true"}}`,
},
}, &chart.Config{})
if err != nil {
t.Errorf("Failed with %s", err)
}
result := v.AsMap()
expected := map[string]interface{}{
"logstash": map[string]interface{}{
"global": map[string]interface{}{},
"livenessProbe": map[string]interface{}{
"exec": "/bin/true",
},
},
}
if !reflect.DeepEqual(result, expected) {
t.Errorf("got %+v, expected %+v", result, expected)
}
} The problem, so far as I can tell, is that Lines 164 to 180 in e04fa72
ie line 173 above is called with the Unfortunately I'm unlikely to have time available in the near future to go any further - I've changed roles and am not currently using Helm, and the answer on how to solve isn't obvious to me. Hopefully the above is helpful in resolving. |
In fact, I just upgraded 2.14.0 => 2.14.2. Not only does the |
@aeijdenberg can you please look into @sgillespie's inquiry? If there's a regression, then it's probably safer to back that PR out unless you can determine a fix. If you're unable to help out then it's probably safer to revert your commit and go back to square 1. Let me know how you'd like to proceed. |
@bacongobbler , while I haven't explictly tested 2.14.0, what @sgillespie matches the behaviour I referred to in #5184 (comment). Sadly I think it's a case of the unit tests passing, but the end to end failing - as the individual components are being used in series, which makes removing a key in an earlier stage makes it have no effect in later stages (and is why the original values are coming through). I agree it's a regression, though backing it out is also a regression for anyone relying on the new behaviour. I've had a quick go at a relatively minor patch which I think will reduce the impact (and fixes the test I added above) in #6146 - I'm sorry we got this wrong the in last attempt. |
This might've been fixed in #6080. That PR fixes the case where coalesceDeps is called twice. Can someone confirm with master? If so, can #6146 be closed, or is it attempting to fix a separate issue? I'm trying to grasp my head around the problem space here but it's unclear what these PRs are attempting to solve. Sorry. |
This does indeed seem to fix the issue. A quick naive test: Subchart values:
Parent chart values:
Output as expected is |
This isn't the most recent version available (2.14.3). This version has a bug handling null Chart values helm/helm#5184 which is a regression. We use this feature in our Chart, so this is problematic. Fix is already merged into master so it'll be available in the next version
Hi, I'm using helm Given a subchart with values: securityContext:
runAsUser: 65534
fsGroup: 65534 Where the values are used with And in a parent chart values: sub:
securityContext:
runAsUser: null Then the actual output is: securityContext:
runAsUser: 65534
fsGroup: 65534 While it should have been: securityContext:
fsGroup: 65534 |
still bugged in 3.5.4 |
Still exist in
Can someone reopen the issue and fix it please ? |
Still exist in
|
The reopened issue is #9136 |
Still exist in v3.7.2 |
Still exists in v3.9.2 |
Still exists in 3.11.1 |
still exists in 3.12.3 |
repro:
|
While I was unable to override a default subcharted value with |
Still having this issue in Helm v3.13.2. Unfortunately I cannot use @ccmcbeck's workaround, because the particular value is not fenced with an Overwriting the default value with |
I have created a new issue because this problem persists in the latest version of Kubernetes. |
#2648 allows for deletion of keys by setting
null
values in avalues.yaml
file. However it doesn't work for nested values, e.g.:Will not remove
web.livenessProbe.httpGet
from the original values, rather it just overrides the value withnull
and prints the warning:Ironically, above is a small variant on the example given in the docs, which I'm pretty sure does not actually do what it claims to: https://docs.helm.sh/chart_template_guide/#deleting-a-default-key
I suspect that since the template rendering doesn't seem to differentiate much between a null value and a value not being specified, that this warnings are being ignored and not having much effect.
Output of
helm version
:Output of
kubectl version
:Cloud Provider/Platform (AKS, GKE, Minikube etc.):
EKS
The text was updated successfully, but these errors were encountered: