*: 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:
parent
8538c4067a
commit
5d637f015d
5 changed files with 30 additions and 18 deletions
|
@ -154,6 +154,8 @@ type Sandbox struct {
|
|||
hostname string
|
||||
portMappings []*hostport.PortMapping
|
||||
stopped bool
|
||||
// ipv4 or ipv6 cache
|
||||
ip string
|
||||
}
|
||||
|
||||
const (
|
||||
|
@ -202,6 +204,16 @@ func New(id, namespace, name, kubeName, logDir string, labels, annotations map[s
|
|||
return sb, nil
|
||||
}
|
||||
|
||||
// AddIP stores the ip in the sandbox
|
||||
func (s *Sandbox) AddIP(ip string) {
|
||||
s.ip = ip
|
||||
}
|
||||
|
||||
// IP returns the ip of the sandbox
|
||||
func (s *Sandbox) IP() string {
|
||||
return s.ip
|
||||
}
|
||||
|
||||
// ID returns the id of the sandbox
|
||||
func (s *Sandbox) ID() string {
|
||||
return s.id
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue