server: container_create: store sandbox's ip in annotations
So it can be later retrieved when needed (cadvisor) Signed-off-by: Antonio Murdaca <runcom@redhat.com>
This commit is contained in:
parent
5d637f015d
commit
2ac2832686
5 changed files with 21 additions and 10 deletions
|
@ -66,6 +66,8 @@ type Server struct {
|
|||
appArmorProfile string
|
||||
|
||||
stream streamService
|
||||
|
||||
bindAddress string
|
||||
}
|
||||
|
||||
// GetExec returns exec stream request
|
||||
|
@ -233,6 +235,7 @@ func New(config *Config) (*Server, error) {
|
|||
return nil, err
|
||||
}
|
||||
}
|
||||
s.bindAddress = bindAddress.String()
|
||||
|
||||
_, err = net.LookupPort("tcp", config.StreamPort)
|
||||
if err != nil {
|
||||
|
@ -289,6 +292,11 @@ func (s *Server) getInfraContainer(id string) *oci.Container {
|
|||
return s.ContainerServer.GetInfraContainer(id)
|
||||
}
|
||||
|
||||
// BindAddress is used to retrieve host's IP
|
||||
func (s *Server) BindAddress() string {
|
||||
return s.bindAddress
|
||||
}
|
||||
|
||||
// GetSandboxContainer returns the infra container for a given sandbox
|
||||
func (s *Server) GetSandboxContainer(id string) *oci.Container {
|
||||
return s.ContainerServer.GetSandboxContainer(id)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue