Skip to content
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

deepCopy, will not override an integer value with the value 0 #11618

Closed
cunningr opened this issue Dec 9, 2022 · 3 comments
Closed

deepCopy, will not override an integer value with the value 0 #11618

cunningr opened this issue Dec 9, 2022 · 3 comments
Labels
bug Categorizes issue or PR as related to a bug. Stale

Comments

@cunningr
Copy link

cunningr commented Dec 9, 2022

Output of helm version:

version.BuildInfo{Version:"v3.8.2", GitCommit:"6e3701edea09e5d55a8ca2aae03a68917630e91b", GitTreeState:"clean", GoVersion:"go1.18.1"}

Output of kubectl version:

N/A

Cloud Provider/Platform (AKS, GKE, Minikube etc.):

CAPI/Openstack, vanilla k8s.

Issue:

When doing a deepCopy, it is not possible to override an integer value with the value 0. I am not sure if this is a bug or a know behaviour (but it is a little annoying :-)).

We can reproduce this in the helm playground

With values:

---
rolloutStrategy1:
  type: RollingUpdate
  rollingUpdate:
    maxUnavailable: 1
    maxSurge: 1

rolloutStrategy2:
  type: RollingUpdate
  rollingUpdate:
    maxUnavailable: 0
    maxSurge: 1

and template:

---
{{- $nodeGroup := deepCopy $.Values.rolloutStrategy1 | mustMerge $.Values.rolloutStrategy2 }}
{{ toYaml $nodeGroup }}

I would expect the values in rolloutStrategy2 to override the values in rolloutStrategy1, which they do, unless the value is a 0.

@yxxhero
Copy link
Member

yxxhero commented Dec 12, 2022

@cunningr you should post an issue at https://github.com/Masterminds/sprig.

@cunningr
Copy link
Author

Thanks @yxxhero I have filed this issue

@joejulian joejulian added bug Categorizes issue or PR as related to a bug. and removed question/support labels Dec 24, 2022
@github-actions
Copy link

This issue has been marked as stale because it has been open for 90 days with no activity. This thread will be automatically closed in 30 days if no further activity occurs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Categorizes issue or PR as related to a bug. Stale
Projects
None yet
Development

No branches or pull requests

3 participants