Vendor containers/image and containers/storage
Vendor updated containers/image and containers/storage, along with any new dependencies they drag in, and updated versions of other dependencies that happen to get pulled in. github.com/coreos/go-systemd/daemon/SdNotify() now takes a boolean to control whether or not it unsets the NOTIFY_SOCKET variable from the calling process's environment. Adapt. github.com/opencontainers/runtime-tools/generate/Generator.AddProcessEnv() now takes the environment variable name and value as two arguments, not one. Adapt. Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
This commit is contained in:
parent
00e6832715
commit
caee4a99c9
100 changed files with 2636 additions and 404 deletions
23
vendor/github.com/opencontainers/runtime-tools/generate/generate.go
generated
vendored
23
vendor/github.com/opencontainers/runtime-tools/generate/generate.go
generated
vendored
|
@ -196,6 +196,16 @@ func (g *Generator) Spec() *rspec.Spec {
|
|||
func (g *Generator) Save(w io.Writer, exportOpts ExportOptions) (err error) {
|
||||
var data []byte
|
||||
|
||||
if g.spec.Linux != nil {
|
||||
buf, err := json.Marshal(g.spec.Linux)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if string(buf) == "{}" {
|
||||
g.spec.Linux = nil
|
||||
}
|
||||
}
|
||||
|
||||
if exportOpts.Seccomp {
|
||||
data, err = json.MarshalIndent(g.spec.Linux.Seccomp, "", "\t")
|
||||
} else {
|
||||
|
@ -331,9 +341,18 @@ func (g *Generator) ClearProcessEnv() {
|
|||
g.spec.Process.Env = []string{}
|
||||
}
|
||||
|
||||
// AddProcessEnv adds env into g.spec.Process.Env.
|
||||
func (g *Generator) AddProcessEnv(env string) {
|
||||
// AddProcessEnv adds name=value into g.spec.Process.Env, or replaces an
|
||||
// existing entry with the given name.
|
||||
func (g *Generator) AddProcessEnv(name, value string) {
|
||||
g.initSpec()
|
||||
|
||||
env := fmt.Sprintf("%s=%s", name, value)
|
||||
for idx := range g.spec.Process.Env {
|
||||
if strings.HasPrefix(g.spec.Process.Env[idx], name+"=") {
|
||||
g.spec.Process.Env[idx] = env
|
||||
return
|
||||
}
|
||||
}
|
||||
g.spec.Process.Env = append(g.spec.Process.Env, env)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue