*: store sandbox IP

Don't call into net namespace on every status call

Signed-off-by: Antonio Murdaca <runcom@redhat.com>
This commit is contained in:
Antonio Murdaca 2017-08-30 00:57:26 +02:00
parent 8538c4067a
commit 5d637f015d
No known key found for this signature in database
GPG key ID: B2BEAD150DE936B9
5 changed files with 30 additions and 18 deletions

View file

@ -294,6 +294,8 @@ func (c *ContainerServer) LoadSandbox(id string) error {
return err
}
ip := m.Annotations[annotations.IP]
processLabel, mountLabel, err := label.InitLabels(label.DupSecOpt(m.Process.SelinuxLabel))
if err != nil {
return err
@ -311,6 +313,7 @@ func (c *ContainerServer) LoadSandbox(id string) error {
if err != nil {
return err
}
sb.AddIP(ip)
// We add a netNS only if we can load a permanent one.
// Otherwise, the sandbox will live in the host namespace.