@@ -10,30 +10,35 @@ import (
10
10
"github.com/openfaas-incubator/ofc-bootstrap/pkg/types"
11
11
)
12
12
13
- type TlsTemplate struct {
14
- RootDomain string
15
- Email string
16
- DNSService string
17
- ProjectID string
18
- IssuerType string
19
- Region string
20
- AccessKeyID string
13
+ // TLSTemplate TLS configuration
14
+ type TLSTemplate struct {
15
+ RootDomain string
16
+ Email string
17
+ DNSService string
18
+ ProjectID string
19
+ IssuerType string
20
+ Region string
21
+ AccessKeyID string
22
+ DigitalOceanAccessToken string
21
23
}
22
24
23
25
var tlsTemplatesPath = "templates/k8s/tls/"
24
26
27
+ // Apply executes the plan
25
28
func Apply (plan types.Plan ) error {
26
29
27
30
tlsTemplatesList , _ := listTLSTemplates ()
28
- tlsTemplate := TlsTemplate {
29
- RootDomain : plan .RootDomain ,
30
- Email : plan .TLSConfig .Email ,
31
- DNSService : plan .TLSConfig .DNSService ,
32
- ProjectID : plan .TLSConfig .ProjectID ,
33
- IssuerType : plan .TLSConfig .IssuerType ,
34
- Region : plan .TLSConfig .Region ,
35
- AccessKeyID : plan .TLSConfig .AccessKeyID ,
31
+ tlsTemplate := TLSTemplate {
32
+ RootDomain : plan .RootDomain ,
33
+ Email : plan .TLSConfig .Email ,
34
+ DNSService : plan .TLSConfig .DNSService ,
35
+ ProjectID : plan .TLSConfig .ProjectID ,
36
+ IssuerType : plan .TLSConfig .IssuerType ,
37
+ Region : plan .TLSConfig .Region ,
38
+ AccessKeyID : plan .TLSConfig .AccessKeyID ,
39
+ DigitalOceanAccessToken : plan .TLSConfig .DigitalOceanAccessToken ,
36
40
}
41
+
37
42
for _ , template := range tlsTemplatesList {
38
43
tempFilePath , tlsTemplateErr := generateTemplate (template , tlsTemplate )
39
44
if tlsTemplateErr != nil {
@@ -66,7 +71,7 @@ func listTLSTemplates() ([]string, error) {
66
71
return list , nil
67
72
}
68
73
69
- func generateTemplate (fileName string , tlsTemplate TlsTemplate ) (string , error ) {
74
+ func generateTemplate (fileName string , tlsTemplate TLSTemplate ) (string , error ) {
70
75
71
76
data , err := ioutil .ReadFile (tlsTemplatesPath + fileName )
72
77
if err != nil {
0 commit comments