Skip to content

Commit 6687985

Browse files
author
zhouhao
committed
image: modify to create bundlle
Signed-off-by: zhouhao <[email protected]>
1 parent 8989b30 commit 6687985

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

image/config.go

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,14 @@ func findConfig(w walker, d *descriptor) (*config, error) {
6666
}
6767

6868
func (c *config) runtimeSpec(rootfs string) (*specs.Spec, error) {
69-
if c.OS != "linux" {
69+
switch c.OS {
70+
case "linux":
71+
s.Linux = &specs.Linux{}
72+
case "solaris":
73+
s.Solaris = &specs.Solaris{}
74+
case "winodws":
75+
s.Windows = &specs.Windows{}
76+
default:
7077
return nil, fmt.Errorf("%s: unsupported OS", c.OS)
7178
}
7279

@@ -109,8 +116,6 @@ func (c *config) runtimeSpec(rootfs string) (*specs.Spec, error) {
109116
s.Platform.OS = c.OS
110117
s.Platform.Arch = c.Architecture
111118

112-
s.Linux = &specs.Linux{}
113-
114119
for vol := range c.Config.Volumes {
115120
s.Mounts = append(
116121
s.Mounts,

0 commit comments

Comments
 (0)