Skip to content
This repository has been archived by the owner on Jul 23, 2019. It is now read-only.

Enable platform dependent bootstrap ignition files #102

Merged
merged 1 commit into from
Jun 14, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 25 additions & 2 deletions pkg/asset/ignition/bootstrap/bootstrap.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,28 @@ func (a *Bootstrap) Generate(dependencies asset.Parents) error {
if err != nil {
return err
}

// Check for optional platform specific files/units
platform := installConfig.Config.Platform.Name()
platformFilePath := fmt.Sprintf("bootstrap/%s/files", platform)
directory, err := data.Assets.Open(platformFilePath)
if directory != nil {
directory.Close()
err = a.addStorageFiles("/", platformFilePath, templateData)
if err != nil {
return err
}
}
platformUnitPath := fmt.Sprintf("bootstrap/%s/systemd/units", platform)
directory, err = data.Assets.Open(platformUnitPath)
if directory != nil {
directory.Close()
err = a.addSystemdUnits(platformUnitPath, templateData)
if err != nil {
return err
}
}

a.addParentFiles(dependencies)

a.Config.Passwd.Users = append(
Expand Down Expand Up @@ -247,10 +269,11 @@ func (a *Bootstrap) addSystemdUnits(uri string, templateData *bootstrapTemplateD
"progress.service": {},
"kubelet.service": {},
"chown-gatewayd-key.service": {},
"keepalived.service": {},
"coredns.service": {},
"systemd-journal-gatewayd.socket": {},
"approve-csr.service": {},
// baremetal platform services
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Long term our plan is to move away from using systemd services on the bootstrap node too, but in the meantime this looks good.

"keepalived.service": {},
"coredns.service": {},
}

directory, err := data.Assets.Open(uri)
Expand Down