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

Commit

Permalink
Merge pull request #102 from hardys/baremetal_bootstrap
Browse files Browse the repository at this point in the history
Enable platform dependent bootstrap ignition files
  • Loading branch information
stbenjam authored Jun 14, 2019
2 parents f92e7f9 + 6aba139 commit 27dc191
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 2 deletions.
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
"keepalived.service": {},
"coredns.service": {},
}

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

0 comments on commit 27dc191

Please sign in to comment.