Skip to content

Commit c50707b

Browse files
author
zhouhao
committed
image: modify to create bundlle
Signed-off-by: zhouhao <zhouhao@cn.fujitsu.com>
1 parent b686775 commit c50707b

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

image/config.go

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,19 @@ func findConfig(w walker, d *v1.Descriptor) (*config, error) {
6666
}
6767

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

73-
var s specs.Spec
7482
s.Version = specs.Version
7583
// we should at least apply the default spec, otherwise this is totally useless
7684
s.Process.Terminal = true
@@ -106,8 +114,6 @@ func (c *config) runtimeSpec(rootfs string) (*specs.Spec, error) {
106114
return nil, errors.New("config.User: unsupported format")
107115
}
108116

109-
s.Linux = &specs.Linux{}
110-
111117
for vol := range c.Config.Volumes {
112118
s.Mounts = append(
113119
s.Mounts,

0 commit comments

Comments
 (0)