helm / helm/community

Proposal: helm upgrade --reuse-value

Open
#342 0 comments 4 reactions 0 assignees View on GitHub
Dominant language
No language data
Stars
495
Forks
210
PR merge metrics
No merged PRs in 30d

Description

Hello Helm community and maintainers!

I would like to propose a new flag to the `upgrade` command, `--reuse-value`. Similarly to `--reuse-values`, `--reuse-value` would instead allow me to specify exactly which keys I want to be reused from the previous upgrade as opposed to reusing all values from the previous upgrade.

# Problem

To illustrate the idea completely, consider the following `values.yaml`:

```yaml
image:
tag:
stable: "v1"
canary: "v1"
secretVersion: "1"
```

As expected, after the initial chart installation, `helm get values [release]` would return the values defined in that file. When doing an upgrade, it would be useful to be able to update only the `image.tag.canary` value, so I could do this:

```
$ helm upgrade [release] [chart] --reuse-values --set image.tag.canary=v2
```

...which gives me my desired outcome of deployed values:

```
$ helm get values [release]
image:
tag:
stable: "v1"
canary: "v2"
secretVersion: "1"
```

However, if I made a change to my values.yaml (in source control) to update the secret version to "2" and push that through a pipeline which effectively runs:

```
$ helm upgrade [release] [chart] --reuse-values --set image.tag.canary=v2
```

...the output is not what I intended:

```
$ cat values.yaml
image:
tag:
stable: "v1"
canary: "v1"
secretVersion: "2"

$ helm get values [release]
image:
tag:
stable: "v1"
canary: "v2"
secretVersion: "1"
```

The core of the issue is that some values are "owned" by the pipeline (the latest image tag build) while others are intended to be "owned" by the values.yaml file itself in source control.

# Proposal

Allow Helm users to define which values should be reused with a new `--reuse-value` list:

```
$ helm upgrade [release] [chart] --reuse-value image.tag.stable --set image.tag.canary=v2
```

This should produce the following:

```
$ helm get values [release]
image:
tag:
stable: "v1"
canary: "v2"
secretVersion: "2"
```

# Conclusion

Perhaps it is not a correct approach to manage source-control owned configuration in a values.yaml file. I am open to suggestions here. In chart implementations I have seen (which are few - I am a new Helm user 👋), this is the case. Because of the behavior of `--reuse-values`, it seems too dangerous for use in an automated pipeline.

Thank you in advance for reading and for any discussion points!

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.