-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
/
repo.go
31 lines (25 loc) · 1.21 KB
/
repo.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
26
27
28
29
30
31
package helm
import (
"github.com/stretchr/testify/require"
"github.com/gruntwork-io/terratest/modules/testing"
)
// AddRepo will setup the provided helm repository to the local helm client configuration. This will fail the test if
// there is an error.
func AddRepo(t testing.TestingT, options *Options, repoName string, repoURL string) {
require.NoError(t, AddRepoE(t, options, repoName, repoURL))
}
// AddRepoE will setup the provided helm repository to the local helm client configuration.
func AddRepoE(t testing.TestingT, options *Options, repoName string, repoURL string) error {
_, err := RunHelmCommandAndGetOutputE(t, options, "repo", "add", repoName, repoURL)
return err
}
// RemoveRepo will remove the provided helm repository from the local helm client configuration. This will fail the test
// if there is an error.
func RemoveRepo(t testing.TestingT, options *Options, repoName string) {
require.NoError(t, RemoveRepoE(t, options, repoName))
}
// RemoveRepoE will remove the provided helm repository from the local helm client configuration.
func RemoveRepoE(t testing.TestingT, options *Options, repoName string) error {
_, err := RunHelmCommandAndGetOutputE(t, options, "repo", "remove", repoName)
return err
}