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 <zhouhao@cn.fujitsu.com>
  • Loading branch information
zhouhao committed Jul 24, 2017
1 parent b686775 commit c50707b
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions image/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,19 @@ func findConfig(w walker, d *v1.Descriptor) (*config, error) {
}

func (c *config) runtimeSpec(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{}
default:
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.Process.Terminal = true
Expand Down Expand Up @@ -106,8 +114,6 @@ func (c *config) runtimeSpec(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 c50707b

Please sign in to comment.