Skip to content

Commit

Permalink
Merge pull request #19221 from dfr/freebsd-rootfs
Browse files Browse the repository at this point in the history
pkg/specgen: fix support for --rootfs on FreeBSD
  • Loading branch information
openshift-merge-robot authored Jul 13, 2023
2 parents 69f112a + e43127e commit 7a93a28
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions pkg/specgen/generate/oci_freebsd.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,16 @@ import (

// SpecGenToOCI returns the base configuration for the container.
func SpecGenToOCI(ctx context.Context, s *specgen.SpecGenerator, rt *libpod.Runtime, rtc *config.Config, newImage *libimage.Image, mounts []spec.Mount, pod *libpod.Pod, finalCmd []string, compatibleOptions *libpod.InfraInherit) (*spec.Spec, error) {
inspectData, err := newImage.Inspect(ctx, nil)
if err != nil {
return nil, err
var imageOs string
if newImage != nil {
inspectData, err := newImage.Inspect(ctx, nil)
if err != nil {
return nil, err
}
imageOs = inspectData.Os
} else {
imageOs = "freebsd"
}
imageOs := inspectData.Os

if imageOs != "freebsd" && imageOs != "linux" {
return nil, fmt.Errorf("unsupported image OS: %s", imageOs)
Expand Down

0 comments on commit 7a93a28

Please sign in to comment.