Skip to content

Commit

Permalink
image: modify to create bundlle
Browse files Browse the repository at this point in the history
Signed-off-by: zhouhao <[email protected]>
  • Loading branch information
zhouhao committed Jan 24, 2018
1 parent 974de27 commit b3ad990
Showing 1 changed file with 9 additions and 4 deletions.
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

0 comments on commit b3ad990

Please sign in to comment.