-
Notifications
You must be signed in to change notification settings - Fork 6
/
template.go
46 lines (36 loc) · 1.24 KB
/
template.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
package azure
import (
_ "embed"
)
//go:embed cluster.yaml.tmpl
var cluster string
//go:embed azure_cluster.yaml.tmpl
var azureCluster string
//go:embed kubeadm_control_plane.yaml.tmpl
var kubeadmControlPlane string
//go:embed azure_machine_template.yaml.tmpl
var azureMachineTemplate string
//go:embed bastion_secret.yaml.tmpl
var bastionSecret string
//go:embed bastion_machine_deployment.yaml.tmpl
var bastionMachineDeployment string
//go:embed bastion_azure_machine_template.yaml.tmpl
var bastionAzureMachineTemplate string
type Template struct {
Name string
Data string
}
// GetTemplate merges all .tmpl files.
func GetTemplates() []Template {
// Order is important here.
// The order in this slice determines in which order files will be applied.
return []Template{
{Name: "cluster.yaml.tmpl", Data: cluster},
{Name: "azure_cluster.yaml.tmpl", Data: azureCluster},
{Name: "kubeadm_control_plane.yaml.tmpl", Data: kubeadmControlPlane},
{Name: "azure_machine_template.yaml.tmpl", Data: azureMachineTemplate},
{Name: "bastion_secret.yaml.tmpl", Data: bastionSecret},
{Name: "bastion_machine_deployment.yaml.tmpl", Data: bastionMachineDeployment},
{Name: "bastion_azure_machine_template.yaml.tmpl", Data: bastionAzureMachineTemplate},
}
}