Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions endpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ type Endpoint interface {

// Retrieve the interfaces' statistics from the sandbox
Statistics() (map[string]*sandbox.InterfaceStatistics, error)

// Retrieve the interfaces from sandbox, for restoring checkpointed container
SandboxInterfaces() []sandbox.Interface
}

// EndpointOption is a option setter function type used to pass varios options to Network
Expand Down Expand Up @@ -583,6 +586,17 @@ func (ep *endpoint) Statistics() (map[string]*sandbox.InterfaceStatistics, error
return m, nil
}

func (ep *endpoint) SandboxInterfaces() []sandbox.Interface {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would return all the interfaces in the sandbox, also the one connecting to other endpoints.
Since this function belongs to Endpoint API, I'd expect it to return only the interface owned by this Endpoint.

If the goal instead is to get all the interfaces on the sandbox, I think we should wait for #365 to be merged and add the new API to the Sandbox interface.

n := ep.network

n.Lock()
c := n.ctrlr
n.Unlock()

sbox := c.sandboxGet(ep.container.data.SandboxKey)
return sbox.Info().Interfaces()
}

func (ep *endpoint) deleteEndpoint() error {
ep.Lock()
n := ep.network
Expand Down