Skip to content
Merged
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
15 changes: 15 additions & 0 deletions pkg/daemon/daemon.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,13 @@ import (
type Daemon struct {
// name is the node name.
name string

// OperatingSystem the operating system the MCD is running on
OperatingSystem string

// IgnitionVersion is the version of the installed Ignition binary on the system
IgnitionVersion string

// mock is set if we're running as non-root, probably under unit tests
mock bool

Expand Down Expand Up @@ -115,6 +119,8 @@ type Daemon struct {
}

const (
// pathIgnition is the path where the ignition binary resides
pathIgnition = "/usr/lib/dracut/modules.d/30ignition/ignition"
// pathSystemd is the path systemd modifiable units, services, etc.. reside
pathSystemd = "/etc/systemd/system"
// wantsPathSystemd is the path where enabled units should be linked
Expand Down Expand Up @@ -190,6 +196,7 @@ func New(
var (
osImageURL string
osVersion string
ignVersion string
err error
)

Expand All @@ -209,6 +216,13 @@ func New(
return nil, fmt.Errorf("error reading osImageURL from rpm-ostree: %v", err)
}
glog.Infof("Booted osImageURL: %s (%s)", osImageURL, osVersion)

ignVersionBytes, err := exec.Command(pathIgnition, "--version").Output()
if err != nil {
return nil, fmt.Errorf("error getting installed Ignition version: %v", err)
}
ignVersion = strings.SplitAfter(string(ignVersionBytes), " ")[1]
glog.Infof("Installed Ignition binary version: %s", ignVersion)
}

bootID := ""
Expand Down Expand Up @@ -237,6 +251,7 @@ func New(
return &Daemon{
mock: mock,
booting: true,
IgnitionVersion: ignVersion,
OperatingSystem: operatingSystem,
NodeUpdaterClient: nodeUpdaterClient,
bootedOSImageURL: osImageURL,
Expand Down