Merge pull request #624 from rhatdan/vendor1

Vendor in latest opencontainers/runtime-tools
This commit is contained in:
Mrunal Patel 2017-06-22 17:00:45 -07:00 committed by GitHub
commit 4d46ae6e1e
4 changed files with 26 additions and 5 deletions

View file

@ -11,7 +11,7 @@ github.com/containernetworking/cni v0.4.0
google.golang.org/grpc v1.0.1-GA https://github.com/grpc/grpc-go
github.com/opencontainers/selinux v1.0.0-rc1
github.com/opencontainers/go-digest v1.0.0-rc0
github.com/opencontainers/runtime-tools f5c82b3918bdfc3ed4b594dcfab4d1554beaf992
github.com/opencontainers/runtime-tools 96cb7c28a32209a530b94bceb491e0137d1f5849
github.com/opencontainers/runc b263a43430ac6996a4302b891688544225197294
github.com/opencontainers/image-spec v1.0.0-rc6
github.com/opencontainers/runtime-spec v1.0.0-rc5

View file

@ -714,12 +714,15 @@ func (g *Generator) ClearPreStartHooks() {
if g.spec == nil {
return
}
if g.spec.Hooks == nil {
return
}
g.spec.Hooks.Prestart = []rspec.Hook{}
}
// AddPreStartHook add a prestart hook into g.spec.Hooks.Prestart.
func (g *Generator) AddPreStartHook(path string, args []string) {
g.initSpec()
g.initSpecHooks()
hook := rspec.Hook{Path: path, Args: args}
g.spec.Hooks.Prestart = append(g.spec.Hooks.Prestart, hook)
}
@ -729,12 +732,15 @@ func (g *Generator) ClearPostStopHooks() {
if g.spec == nil {
return
}
if g.spec.Hooks == nil {
return
}
g.spec.Hooks.Poststop = []rspec.Hook{}
}
// AddPostStopHook adds a poststop hook into g.spec.Hooks.Poststop.
func (g *Generator) AddPostStopHook(path string, args []string) {
g.initSpec()
g.initSpecHooks()
hook := rspec.Hook{Path: path, Args: args}
g.spec.Hooks.Poststop = append(g.spec.Hooks.Poststop, hook)
}
@ -744,12 +750,15 @@ func (g *Generator) ClearPostStartHooks() {
if g.spec == nil {
return
}
if g.spec.Hooks == nil {
return
}
g.spec.Hooks.Poststart = []rspec.Hook{}
}
// AddPostStartHook adds a poststart hook into g.spec.Hooks.Poststart.
func (g *Generator) AddPostStartHook(path string, args []string) {
g.initSpec()
g.initSpecHooks()
hook := rspec.Hook{Path: path, Args: args}
g.spec.Hooks.Poststart = append(g.spec.Hooks.Poststart, hook)
}

View file

@ -17,6 +17,13 @@ func (g *Generator) initSpecAnnotations() {
}
}
func (g *Generator) initSpecHooks() {
g.initSpec()
if g.spec.Hooks == nil {
g.spec.Hooks = &rspec.Hooks{}
}
}
func (g *Generator) initSpecLinux() {
g.initSpec()
if g.spec.Linux == nil {

View file

@ -131,8 +131,13 @@ func (v *Validator) CheckRootfsPath() (msgs []string) {
msgs = append(msgs, fmt.Sprintf("root.path is %q, but it MUST be a child of %q", v.spec.Root.Path, absBundlePath))
}
return
if v.spec.Platform.OS == "windows" {
if v.spec.Root.Readonly {
msgs = append(msgs, "root.readonly field MUST be omitted or false when platform.os is windows")
}
}
return
}
// CheckSemVer checks v.spec.Version