forked from joeholley/supergloo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.go
89 lines (70 loc) · 2.68 KB
/
install.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
package surveyutils
import (
"context"
"github.com/solo-io/gloo/pkg/cliutil"
"github.com/solo-io/supergloo/cli/pkg/constants"
"github.com/solo-io/supergloo/cli/pkg/helpers/clients"
"github.com/solo-io/supergloo/cli/pkg/options"
)
func SurveyIstioInstall(in *options.Install) error {
if err := cliutil.ChooseFromList("which namespace to install to? ", &in.InstallationNamespace.Istio, clients.MustGetNamespaces()); err != nil {
return err
}
if err := cliutil.ChooseFromList("which version of Istio to install? ", &in.IstioInstall.IstioVersion, constants.SupportedIstioVersions); err != nil {
return err
}
if err := cliutil.GetBoolInput("enable mtls? ", &in.IstioInstall.EnableMtls); err != nil {
return err
}
if err := cliutil.GetBoolInput("enable auto-injection? ", &in.IstioInstall.EnableAutoInject); err != nil {
return err
}
if err := cliutil.GetBoolInput("add grafana to the install? ", &in.IstioInstall.InstallGrafana); err != nil {
return err
}
if err := cliutil.GetBoolInput("add prometheus to the install? ", &in.IstioInstall.InstallPrometheus); err != nil {
return err
}
if err := cliutil.GetBoolInput("add jaeger to the install? ", &in.IstioInstall.InstallJaeger); err != nil {
return err
}
if err := cliutil.GetBoolInput("update an existing install? ", &in.Update); err != nil {
return err
}
return nil
}
func SurveyLinkerdInstall(in *options.Install) error {
if err := cliutil.ChooseFromList("which namespace to install to? ", &in.InstallationNamespace.Linkerd, clients.MustGetNamespaces()); err != nil {
return err
}
if err := cliutil.ChooseFromList("which version of Linkerd to install? ", &in.LinkerdInstall.LinkerdVersion, constants.SupportedLinkerdVersions); err != nil {
return err
}
if err := cliutil.GetBoolInput("enable mtls? ", &in.LinkerdInstall.EnableMtls); err != nil {
return err
}
if err := cliutil.GetBoolInput("enable auto-injection? ", &in.LinkerdInstall.EnableAutoInject); err != nil {
return err
}
if err := cliutil.GetBoolInput("update an existing install? ", &in.Update); err != nil {
return err
}
return nil
}
func SurveyGlooInstall(ctx context.Context, in *options.Install) error {
if err := cliutil.ChooseFromList("which namespace to install to? ", &in.InstallationNamespace.Gloo, clients.MustGetNamespaces()); err != nil {
return err
}
if err := cliutil.ChooseFromList("which version of Gloo to install? ", &in.GlooIngressInstall.GlooVersion, constants.SupportedGlooVersions); err != nil {
return err
}
refs, err := SurveyMeshes(ctx)
if err != nil {
return err
}
in.GlooIngressInstall.Meshes = refs
if err := cliutil.GetBoolInput("update an existing install? ", &in.Update); err != nil {
return err
}
return nil
}