-
Notifications
You must be signed in to change notification settings - Fork 3
/
helm_install_opts.go
44 lines (36 loc) · 1.07 KB
/
helm_install_opts.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
32
33
34
35
36
37
38
39
40
41
42
43
44
package helm
import (
"time"
"github.com/dapr-sandbox/dapr-kubernetes-operator/pkg/utils/mergemap"
"helm.sh/helm/v3/pkg/action"
)
func WithInstallName(value string) InstallOption {
return func(install *ReleaseOptions[action.Install]) {
install.Client.ReleaseName = value
}
}
func WithInstallNamespace(value string) InstallOption {
return func(install *ReleaseOptions[action.Install]) {
install.Client.Namespace = value
}
}
func WithInstallValue(name string, value interface{}) InstallOption {
return func(install *ReleaseOptions[action.Install]) {
install.Values[name] = value
}
}
func WithInstallVersion(value string) InstallOption {
return func(install *ReleaseOptions[action.Install]) {
install.Client.Version = value
}
}
func WithInstallValues(values map[string]interface{}) InstallOption {
return func(install *ReleaseOptions[action.Install]) {
install.Values = mergemap.Merge(install.Values, values)
}
}
func WithInstallTimeout(value time.Duration) InstallOption {
return func(install *ReleaseOptions[action.Install]) {
install.Client.Timeout = value
}
}