mirror of
https://github.com/argoproj/argo-cd
synced 2026-05-24 01:38:43 +00:00
* fix: Allow unsetting the last values file (#3644) Because the `setHelmOpt()` function does not act on empty inputs, it would do nothing when removing the last values file using `argocd app unset`. The parameter overrides are actually being unset correctly, so this has been changed to work the same way by manipulating `app.Spec.Source.Helm` directly. This fixes #3644. * fix: Allow unsetting the last values file, add tests * Retrigger CI pipeline
This commit is contained in:
parent
d89b7d8a41
commit
7b2a95e83c
1 changed files with 28 additions and 0 deletions
|
|
@ -123,6 +123,34 @@ func TestHelmValues(t *testing.T) {
|
|||
})
|
||||
}
|
||||
|
||||
func TestHelmValuesMultipleUnset(t *testing.T) {
|
||||
Given(t).
|
||||
Path("helm").
|
||||
When().
|
||||
AddFile("foo.yml", "").
|
||||
AddFile("baz.yml", "").
|
||||
Create().
|
||||
AppSet("--values", "foo.yml", "--values", "baz.yml").
|
||||
Then().
|
||||
And(func(app *Application) {
|
||||
assert.NotNil(t, app.Spec.Source.Helm)
|
||||
assert.Equal(t, []string{"foo.yml", "baz.yml"}, app.Spec.Source.Helm.ValueFiles)
|
||||
}).
|
||||
When().
|
||||
AppUnSet("--values", "foo.yml").
|
||||
Then().
|
||||
And(func(app *Application) {
|
||||
assert.NotNil(t, app.Spec.Source.Helm)
|
||||
assert.Equal(t, []string{"baz.yml"}, app.Spec.Source.Helm.ValueFiles)
|
||||
}).
|
||||
When().
|
||||
AppUnSet("--values", "baz.yml").
|
||||
Then().
|
||||
And(func(app *Application) {
|
||||
assert.Nil(t, app.Spec.Source.Helm)
|
||||
})
|
||||
}
|
||||
|
||||
func TestHelmValuesLiteralFileLocal(t *testing.T) {
|
||||
Given(t).
|
||||
Path("helm").
|
||||
|
|
|
|||
Loading…
Reference in a new issue