-
Notifications
You must be signed in to change notification settings - Fork 204
/
utilities.go
49 lines (41 loc) · 1.26 KB
/
utilities.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
package parser
import (
"text/template"
nbcontractv1 "github.com/Azure/agentbaker/pkg/proto/nbcontract/v1"
)
func getBaseTemplate() *nbcontractv1.Configuration {
return &nbcontractv1.Configuration{
ProvisionOutput: "/var/log/azure/cluster-provision-cse-output.log",
LinuxAdminUsername: "azureuser",
RepoDepotEndpoint: "",
MobyVersion: "",
TenantId: "",
KubernetesVersion: "1.26.0",
HyperkubeUrl: "mcr.microsoft.com/oss/kubernetes/",
KubeBinaryUrl: "",
CustomKubeBinaryUrl: "https://acs-mirror.azureedge.net/kubernetes/v1.26.0/binaries/kubernetes-node-linux-amd64.tar.gz",
KubeproxyUrl: "",
CustomCloudConfig: &nbcontractv1.CustomCloudConfig{
IsCustomCloud: false,
},
SshStatus: nbcontractv1.FeatureState_FEATURE_STATE_ENABLED,
}
}
func getBoolStr(state nbcontractv1.FeatureState) string {
if state == nbcontractv1.FeatureState_FEATURE_STATE_ENABLED {
return "true"
}
return "false"
}
func getInverseBoolStr(state nbcontractv1.FeatureState) string {
if state == nbcontractv1.FeatureState_FEATURE_STATE_ENABLED {
return "false"
}
return "true"
}
func getFuncMap() template.FuncMap {
return template.FuncMap{
"getBoolStr": getBoolStr,
"getInverseBoolStr": getInverseBoolStr,
}
}