@@ -29,41 +29,41 @@ import (
2929)
3030
3131// runs a helm install within the minikube vm or container based on the contents of chart *assets.HelmChart
32- func installHelmChart (ctx context.Context , chart * assets.HelmChart ) * exec.Cmd {
32+ func installHelmChart (ctx context.Context , chart * assets.HelmChart ) * exec.Cmd {
3333 args := []string {
3434 fmt .Sprintf ("KUBECONFIG=%s" , path .Join (vmpath .GuestPersistentDir , "kubeconfig" )),
3535 "helm" , "upgrade" , "--install" , chart .Name , chart .Repo , "--create-namespace" ,
3636 }
37- if chart .Namespace != "" {
38- args = append (args , "--namespace" , chart .Namespace )
39- }
37+ if chart .Namespace != "" {
38+ args = append (args , "--namespace" , chart .Namespace )
39+ }
4040
41- if chart .Values != nil {
42- for _ , value := range chart .Values {
43- args = append (args , "--set" , value )
44- }
45- }
41+ if chart .Values != nil {
42+ for _ , value := range chart .Values {
43+ args = append (args , "--set" , value )
44+ }
45+ }
4646
47- if chart .ValueFiles != nil {
48- for _ , value := range chart .ValueFiles {
49- args = append (args , "--values" , value )
50- }
51- }
52-
53- return exec .CommandContext (ctx , "sudo" , args ... )
47+ if chart .ValueFiles != nil {
48+ for _ , value := range chart .ValueFiles {
49+ args = append (args , "--values" , value )
50+ }
5451 }
5552
53+ return exec .CommandContext (ctx , "sudo" , args ... )
54+ }
55+
5656// runs a helm uninstall based on the contents of chart *assets.HelmChart
57- func uninstalllHelmChart (ctx context.Context , chart * assets.HelmChart ) * exec.Cmd {
57+ func uninstalllHelmChart (ctx context.Context , chart * assets.HelmChart ) * exec.Cmd {
5858 args := []string {
5959 fmt .Sprintf ("KUBECONFIG=%s" , path .Join (vmpath .GuestPersistentDir , "kubeconfig" )),
6060 "helm" , "uninstall" , chart .Name ,
61- }
62- if chart .Namespace != "" {
63- args = append (args , "--namespace" , chart .Namespace )
64- }
65- return exec .CommandContext (ctx , "sudo" , args ... )
6661 }
62+ if chart .Namespace != "" {
63+ args = append (args , "--namespace" , chart .Namespace )
64+ }
65+ return exec .CommandContext (ctx , "sudo" , args ... )
66+ }
6767
6868// based on enable will execute installHelmChart or uninstallHelmChart
6969func helmUninstallOrInstall (ctx context.Context , chart * assets.HelmChart , enable bool ) * exec.Cmd {
@@ -86,8 +86,8 @@ func helmInstallBinary(addon *assets.Addon, runner command.Runner) error {
8686 // we copy the binary from /usr/local/bin to /usr/bin because /usr/local/bin is not in PATH in both iso and kicbase
8787 _ , err = runner .RunCmd (exec .Command ("sudo" , "mv" , "/usr/local/bin/helm" , "/usr/bin/helm" ))
8888 if err != nil {
89- return errors .Wrap (err , "installing helm" )
89+ return errors .Wrap (err , "installing helm" )
9090 }
9191 }
9292 return err
93- }
93+ }
0 commit comments