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

Commit

Permalink
Enable platform dependent bootstrap ignition files
Browse files Browse the repository at this point in the history
Some of the additions made should only be enabled for the
baremetal platform, so move these to data/data/bootstrap/baremetal
and adjust the code to conditionally read this depending on the
platform name.

Closes: #62
Related: #64
  • Loading branch information
Steven Hardy committed Jun 12, 2019
1 parent f92e7f9 commit 6aba139
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 6aba139

Please sign in to comment.