Pass --keep-history when so instructed [#24]

This commit is contained in:
Erin Call
2020-01-02 10:58:58 -08:00
parent 7d750f097d
commit 17724e7015
7 changed files with 32 additions and 7 deletions

View File

@@ -38,6 +38,7 @@ type Config struct {
DryRun bool `split_words:"true"` // Pass --dry-run to applicable helm commands
Wait bool `` // Pass --wait to applicable helm commands
ReuseValues bool `split_words:"true"` // Pass --reuse-values to `helm upgrade`
KeepHistory bool `split_words:"true"` // Pass --keep-history to `helm uninstall`
Timeout string `` // Argument to pass to --timeout in applicable helm commands
Chart string `` // Chart argument to use in applicable helm commands
Release string `` // Release argument to use in applicable helm commands

View File

@@ -120,8 +120,9 @@ var uninstall = func(cfg Config) []Step {
steps = append(steps, depUpdate(cfg)...)
}
steps = append(steps, &run.Uninstall{
Release: cfg.Release,
DryRun: cfg.DryRun,
Release: cfg.Release,
DryRun: cfg.DryRun,
KeepHistory: cfg.KeepHistory,
})
return steps

View File

@@ -198,6 +198,7 @@ func (suite *PlanTestSuite) TestUninstall() {
DryRun: true,
Timeout: "think about what you did",
Release: "jetta_id_love_to_change_the_world",
KeepHistory: true,
}
steps := uninstall(cfg)
@@ -220,8 +221,9 @@ func (suite *PlanTestSuite) TestUninstall() {
suite.Require().IsType(&run.Uninstall{}, steps[1])
actual, _ := steps[1].(*run.Uninstall)
expected = &run.Uninstall{
Release: "jetta_id_love_to_change_the_world",
DryRun: true,
Release: "jetta_id_love_to_change_the_world",
DryRun: true,
KeepHistory: true,
}
suite.Equal(expected, actual)
}