9
9
"os"
10
10
"path"
11
11
12
+ "github.com/alexellis/arkade/pkg/apps"
12
13
"github.com/alexellis/arkade/pkg/k8s"
14
+ "github.com/alexellis/arkade/pkg/types"
13
15
14
16
"github.com/alexellis/arkade/pkg"
15
17
"github.com/alexellis/arkade/pkg/config"
@@ -36,7 +38,6 @@ func MakeInstallSealedSecrets() *cobra.Command {
36
38
if err := config .SetKubeconfig (kubeConfigPath ); err != nil {
37
39
return err
38
40
}
39
- fmt .Printf ("Using kubeconfig: %s\n " , kubeConfigPath )
40
41
41
42
wait , _ := command .Flags ().GetBool ("wait" )
42
43
@@ -62,22 +63,7 @@ func MakeInstallSealedSecrets() *cobra.Command {
62
63
63
64
os .Setenv ("HELM_HOME" , path .Join (userPath , ".helm" ))
64
65
65
- _ , err = helm .TryDownloadHelm (userPath , clientArch , clientOS )
66
- if err != nil {
67
- return err
68
- }
69
-
70
66
updateRepo , _ := command .Flags ().GetBool ("update-repo" )
71
- err = helm .AddHelmRepo ("stable" , "https://kubernetes-charts.storage.googleapis.com/" , updateRepo )
72
- if err != nil {
73
- return fmt .Errorf ("unable to add repo %s" , err )
74
- }
75
-
76
- err = helm .FetchChart ("stable/sealed-secrets" , defaultVersion )
77
-
78
- if err != nil {
79
- return fmt .Errorf ("unable fetch chart %s" , err )
80
- }
81
67
82
68
overrides := map [string ]string {}
83
69
@@ -90,11 +76,26 @@ func MakeInstallSealedSecrets() *cobra.Command {
90
76
return err
91
77
}
92
78
93
- err = helm .Helm3Upgrade ("stable/sealed-secrets" ,
94
- namespace , "values.yaml" , defaultVersion , overrides , wait )
79
+ sealedSecretAppOptions := types .DefaultInstallOptions ().
80
+ WithNamespace (namespace ).
81
+ WithHelmPath (path .Join (userPath , ".helm" )).
82
+ WithHelmRepo ("stable/sealed-secrets" ).
83
+ WithHelmURL ("https://charts.helm.sh/stable" ).
84
+ WithOverrides (overrides ).
85
+ WithHelmUpdateRepo (updateRepo ).
86
+ WithWait (wait ).
87
+ WithKubeconfigPath (kubeConfigPath )
88
+
89
+ _ , err = helm .TryDownloadHelm (userPath , clientArch , clientOS )
95
90
if err != nil {
96
- return fmt . Errorf ( "unable to sealed secret chart with helm %s" , err )
91
+ return err
97
92
}
93
+
94
+ _ , err = apps .MakeInstallChart (sealedSecretAppOptions )
95
+ if err != nil {
96
+ return err
97
+ }
98
+
98
99
fmt .Println (SealedSecretsPostInstallMsg )
99
100
return nil
100
101
}
0 commit comments