@@ -2,21 +2,17 @@ package cli
2
2
3
3
import (
4
4
"fmt"
5
- "io"
6
5
"log"
7
6
8
7
ecv1beta1 "github.com/replicatedhq/embedded-cluster/kinds/apis/v1beta1"
9
8
"github.com/replicatedhq/embedded-cluster/operator/pkg/cli/migratev2"
10
9
"github.com/replicatedhq/embedded-cluster/operator/pkg/k8sutil"
11
- "github.com/replicatedhq/embedded-cluster/pkg/helm"
12
- "github.com/replicatedhq/embedded-cluster/pkg/manager"
13
- "github.com/replicatedhq/embedded-cluster/pkg/runtimeconfig"
14
10
"github.com/spf13/cobra"
15
11
)
16
12
17
13
// MigrateV2Cmd returns a cobra command for migrating the installation from v1 to v2.
18
14
func MigrateV2Cmd () * cobra.Command {
19
- var installationFile , migrationSecret , appSlug , appVersionLabel string
15
+ var installationFile string
20
16
21
17
var installation * ecv1beta1.Installation
22
18
@@ -31,12 +27,6 @@ func MigrateV2Cmd() *cobra.Command {
31
27
}
32
28
installation = in
33
29
34
- // set the runtime config from the installation spec
35
- // NOTE: this is run in a pod so the data dir is not available
36
- runtimeconfig .Set (installation .Spec .RuntimeConfig )
37
-
38
- manager .SetServiceName (appSlug )
39
-
40
30
return nil
41
31
},
42
32
RunE : func (cmd * cobra.Command , args []string ) error {
@@ -47,16 +37,7 @@ func MigrateV2Cmd() *cobra.Command {
47
37
return fmt .Errorf ("failed to create kubernetes client: %w" , err )
48
38
}
49
39
50
- helmCLI , err := helm .NewHelm (helm.HelmOptions {
51
- Writer : io .Discard ,
52
- LogFn : log .Printf ,
53
- RESTClientGetterFactory : k8sutil .RESTClientGetterFactory ,
54
- })
55
- if err != nil {
56
- return fmt .Errorf ("failed to create helm client: %w" , err )
57
- }
58
-
59
- err = migratev2 .Run (ctx , log .Printf , cli , helmCLI , installation , migrationSecret , appSlug , appVersionLabel )
40
+ err = migratev2 .Run (ctx , log .Printf , cli , installation )
60
41
if err != nil {
61
42
return fmt .Errorf ("failed to run v2 migration: %w" , err )
62
43
}
@@ -70,25 +51,6 @@ func MigrateV2Cmd() *cobra.Command {
70
51
if err != nil {
71
52
panic (err )
72
53
}
73
- cmd .Flags ().StringVar (& migrationSecret , "migrate-v2-secret" , "" , "The secret name from which to read the license" )
74
- err = cmd .MarkFlagRequired ("migrate-v2-secret" )
75
- if err != nil {
76
- panic (err )
77
- }
78
- cmd .Flags ().StringVar (& appSlug , "app-slug" , "" , "The application slug" )
79
- err = cmd .MarkFlagRequired ("app-slug" )
80
- if err != nil {
81
- panic (err )
82
- }
83
- cmd .Flags ().StringVar (& appVersionLabel , "app-version-label" , "" , "The application version label" )
84
- err = cmd .MarkFlagRequired ("app-version-label" )
85
- if err != nil {
86
- panic (err )
87
- }
88
-
89
- cmd .AddCommand (
90
- MigrateV2InstallManagerCmd (),
91
- )
92
54
93
55
return cmd
94
56
}
0 commit comments