forked from joeholley/supergloo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhelm_values.go
56 lines (49 loc) · 1.42 KB
/
helm_values.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
package linkerd
import (
"github.com/linkerd/linkerd2/controller/gen/config"
"github.com/solo-io/go-utils/errors"
"k8s.io/client-go/kubernetes"
"sigs.k8s.io/yaml"
)
const chartPath_stable221 = "https://storage.googleapis.com/supergloo-charts/linkerd-stable-2.3.0.tgz"
func (o *installOpts) chartURI() (string, error) {
switch o.installVersion {
case Version_stable230:
return chartPath_stable221, nil
}
return "", errors.Errorf("version %v is not a supported linkerd version. supported: %v", o.installVersion, supportedVersions)
}
func (o *installOpts) values(kube kubernetes.Interface) (*injector, string, error) {
opts := newInstallOptionsWithDefaults(o.installNamespace)
opts.proxyAutoInject = o.enableAutoInject
if o.enableMtls {
// cannot currently disable tls in
}
var values *installValues
var cfg *config.All
if linkerdAlreadyInstalled(o.installNamespace, kube) {
var err error
opts := newUpgradeOptions(opts)
values, cfg, err = opts.validateAndBuild(o.installNamespace, kube)
if err != nil {
return nil, "", err
}
} else {
var err error
values, cfg, err = opts.validateAndBuild()
if err != nil {
return nil, "", err
}
}
rawYaml, err := yaml.Marshal(values)
if err != nil {
return nil, "", err
}
injector := &injector{
configs: cfg,
proxyOutboundCapacity: map[string]uint{
values.PrometheusImage: prometheusProxyOutboundCapacity,
},
}
return injector, string(rawYaml), nil
}