Skip to content
Open
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
13 changes: 9 additions & 4 deletions image/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,18 @@ func findConfig(w walker, d *v1.Descriptor) (*v1.Image, error) {
}

func runtimeSpec(c *v1.Image, rootfs string) (*specs.Spec, error) {
if c.OS != "linux" {
var s specs.Spec

switch c.OS {
case "linux":
s.Linux = &specs.Linux{}
case "solaris":
s.Solaris = &specs.Solaris{}
case "windows":
s.Windows = &specs.Windows{}
return nil, fmt.Errorf("%s: unsupported OS", c.OS)
}

var s specs.Spec
s.Version = specs.Version
// we should at least apply the default spec, otherwise this is totally useless
s.Root = &specs.Root{}
Expand Down Expand Up @@ -107,8 +114,6 @@ func runtimeSpec(c *v1.Image, rootfs string) (*specs.Spec, error) {
return nil, errors.New("config.User: unsupported format")
}

s.Linux = &specs.Linux{}

for vol := range c.Config.Volumes {
s.Mounts = append(
s.Mounts,
Expand Down