-
Notifications
You must be signed in to change notification settings - Fork 1.4k
/
Copy pathbootstrap.go
41 lines (32 loc) · 981 Bytes
/
bootstrap.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
package bootstrap
import (
"context"
"github.com/openshift/installer/pkg/asset"
)
const (
bootstrapIgnFilename = "bootstrap.ign"
)
// Bootstrap is an asset that generates the ignition config for bootstrap nodes.
type Bootstrap struct {
Common
}
var _ asset.WritableAsset = (*Bootstrap)(nil)
// Generate generates the ignition config for the Bootstrap asset.
func (a *Bootstrap) Generate(_ context.Context, dependencies asset.Parents) error {
templateData := a.getTemplateData(dependencies, false)
if err := a.generateConfig(dependencies, templateData); err != nil {
return err
}
if err := a.generateFile(bootstrapIgnFilename); err != nil {
return err
}
return nil
}
// Name returns the human-friendly name of the asset.
func (a *Bootstrap) Name() string {
return "Bootstrap Ignition Config"
}
// Load returns the bootstrap ignition from disk.
func (a *Bootstrap) Load(f asset.FileFetcher) (found bool, err error) {
return a.load(f, bootstrapIgnFilename)
}