fix test command for helm 3 (#1080)
This commit is contained in:
parent
c8ba676e19
commit
9fab6851f0
|
|
@ -168,6 +168,11 @@ func (a *App) Destroy(c DestroyConfigProvider) error {
|
|||
}
|
||||
|
||||
func (a *App) Test(c TestConfigProvider) error {
|
||||
if c.Cleanup() && a.helmExecer.IsHelm3() {
|
||||
a.Logger.Warnf("warn: requested cleanup will not be applied. " +
|
||||
"To clean up test resources with Helm 3, you have to remove them manually " +
|
||||
"or set helm.sh/hook-delete-policy\n")
|
||||
}
|
||||
return a.ForEachStateFiltered(func(run *Run) []error {
|
||||
return run.Test(c)
|
||||
})
|
||||
|
|
|
|||
|
|
@ -1206,7 +1206,10 @@ func (st *HelmState) TestReleases(helm helmexec.Interface, cleanup bool, timeout
|
|||
}
|
||||
|
||||
flags := []string{}
|
||||
if cleanup {
|
||||
if helm.IsHelm3() && release.Namespace != "" {
|
||||
flags = append(flags, "--namespace", release.Namespace)
|
||||
}
|
||||
if cleanup && !helm.IsHelm3() {
|
||||
flags = append(flags, "--cleanup")
|
||||
}
|
||||
duration := strconv.Itoa(timeout)
|
||||
|
|
|
|||
Loading…
Reference in New Issue