Skip to content

Commit b3ad990

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

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

image/config.go

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,18 @@ func findConfig(w walker, d *v1.Descriptor) (*v1.Image, error) {
6464
}
6565

6666
func runtimeSpec(c *v1.Image, rootfs string) (*specs.Spec, error) {
67-
if c.OS != "linux" {
67+
var s specs.Spec
68+
69+
switch c.OS {
70+
case "linux":
71+
s.Linux = &specs.Linux{}
72+
case "solaris":
73+
s.Solaris = &specs.Solaris{}
74+
case "windows":
75+
s.Windows = &specs.Windows{}
6876
return nil, fmt.Errorf("%s: unsupported OS", c.OS)
6977
}
7078

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

110-
s.Linux = &specs.Linux{}
111-
112117
for vol := range c.Config.Volumes {
113118
s.Mounts = append(
114119
s.Mounts,

0 commit comments

Comments
 (0)