forked from gruntwork-io/terratest
-
Notifications
You must be signed in to change notification settings - Fork 1
/
delete.go
25 lines (21 loc) · 879 Bytes
/
delete.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
package helm
import (
"testing"
"github.com/stretchr/testify/require"
)
// Delete will delete the provided release from Tiller. If you set purge to true, Tiller will delete the release object
// as well so that the release name can be reused. This will fail the test if there is an error.
func Delete(t *testing.T, options *Options, releaseName string, purge bool) {
require.NoError(t, DeleteE(t, options, releaseName, purge))
}
// DeleteE will delete the provided release from Tiller. If you set purge to true, Tiller will delete the release object
// as well so that the release name can be reused.
func DeleteE(t *testing.T, options *Options, releaseName string, purge bool) error {
args := []string{}
if purge {
args = append(args, "--purge")
}
args = append(args, releaseName)
_, err := RunHelmCommandAndGetOutputE(t, options, "delete", args...)
return err
}