Merge pull request #1814 from stevvooe/panic-client-fix-oci-spec

oci: allocate process if not already set
This commit is contained in:
Michael Crosby 2017-11-28 10:29:57 -05:00 committed by GitHub
commit 9e04cff8e9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -89,6 +89,11 @@ func WithImageConfig(image Image) SpecOpts {
default: default:
return fmt.Errorf("unknown image config media type %s", ic.MediaType) return fmt.Errorf("unknown image config media type %s", ic.MediaType)
} }
if s.Process == nil {
s.Process = &specs.Process{}
}
s.Process.Env = append(s.Process.Env, config.Env...) s.Process.Env = append(s.Process.Env, config.Env...)
cmd := config.Cmd cmd := config.Cmd
s.Process.Args = append(config.Entrypoint, cmd...) s.Process.Args = append(config.Entrypoint, cmd...)