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
22 changes: 20 additions & 2 deletions server/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@ import (
"emperror.dev/errors"
"github.com/apex/log"
"github.com/docker/docker/api/types/container"
dockerImage "github.com/docker/docker/api/types/image"

"github.com/docker/docker/api/types/mount"
"github.com/docker/docker/client"
dockerImage "github.com/docker/docker/api/types/image" // Alias the correct images package
"github.com/docker/docker/pkg/parsers/kernel"

"github.com/pelican-dev/wings/config"
"github.com/pelican-dev/wings/environment"
Expand Down Expand Up @@ -342,6 +344,12 @@ func (ip *InstallationProcess) AfterExecute(containerId string) error {
return err
}

// Get kernel version using the kernel package
v, err := kernel.GetKernelVersion()
if err != nil {
return err
}

f, err := os.OpenFile(ip.GetLogPath(), os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0o600)
if err != nil {
return err
Expand All @@ -361,6 +369,7 @@ func (ip *InstallationProcess) AfterExecute(containerId string) error {
Server UUID: {{.Server.ID}}
Container Image: {{.Script.ContainerImage}}
Container Entrypoint: {{.Script.Entrypoint}}
Kernel Version: {{.KernelVersion}}

|
| Environment Variables
Expand All @@ -376,7 +385,16 @@ func (ip *InstallationProcess) AfterExecute(containerId string) error {
return err
}

if err := tmpl.Execute(f, ip); err != nil {
// Create a data structure that includes both the InstallationProcess and the kernel version
data := struct {
*InstallationProcess
KernelVersion string
}{
InstallationProcess: ip,
KernelVersion: v.String(),
}

if err := tmpl.Execute(f, data); err != nil {
return err
}

Expand Down
Loading