forked from kyma-project/kyma
-
Notifications
You must be signed in to change notification settings - Fork 0
/
global.go
44 lines (36 loc) · 905 Bytes
/
global.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
package overrides
import (
"bytes"
"text/template"
"github.com/kyma-project/kyma/components/installer/pkg/config"
)
const globalsTplStr = `
global:
tlsCrt: "{{.ClusterTLSCert}}"
tlsKey: "{{.ClusterTLSKey}}"
isLocalEnv: {{isLocal}}
domainName: "{{.Domain}}"
remoteEnvCa: "{{.RemoteEnvCa}}"
remoteEnvCaKey: "{{.RemoteEnvCaKey}}"
istio:
tls:
secretName: "istio-ingress-certs"
etcdBackupABS:
containerName: "{{.EtcdBackupABSContainerName}}"
`
// GetGlobalOverrides .
func GetGlobalOverrides(installationData *config.InstallationData) (string, error) {
fmap := template.FuncMap{
"isLocal": installationData.IsLocalInstallation,
}
tmpl, err := template.New("").Funcs(fmap).Parse(globalsTplStr)
if err != nil {
return "", err
}
buf := new(bytes.Buffer)
err = tmpl.Execute(buf, installationData)
if err != nil {
return "", err
}
return buf.String(), nil
}