-
Notifications
You must be signed in to change notification settings - Fork 0
/
node.go
39 lines (35 loc) · 1021 Bytes
/
node.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
package machine
import (
"fmt"
"net/url"
ignition "github.com/coreos/ignition/config/v2_2/types"
"github.com/vincent-petithory/dataurl"
"github.com/openshift/installer/pkg/types"
)
// pointerIgnitionConfig generates a config which references the remote config
// served by the machine config server.
func pointerIgnitionConfig(installConfig *types.InstallConfig, rootCA []byte, role string) *ignition.Config {
return &ignition.Config{
Ignition: ignition.Ignition{
Version: ignition.MaxVersion.String(),
Config: ignition.IgnitionConfig{
Append: []ignition.ConfigReference{{
Source: func() *url.URL {
return &url.URL{
Scheme: "https",
Host: fmt.Sprintf("api.%s:22623", installConfig.ClusterDomain()),
Path: fmt.Sprintf("/config/%s", role),
}
}().String(),
}},
},
Security: ignition.Security{
TLS: ignition.TLS{
CertificateAuthorities: []ignition.CaReference{{
Source: dataurl.EncodeBytes(rootCA),
}},
},
},
},
}
}