Skip to content
Closed
Show file tree
Hide file tree
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
4 changes: 4 additions & 0 deletions libnetwork_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1188,6 +1188,10 @@ func (f *fakeSandbox) Delete() error {
return nil
}

func (f *fakeSandbox) Interfaces() []osl.Interface {
return nil
}

func (f *fakeSandbox) SetKey(key string) error {
return nil
}
Expand Down
10 changes: 10 additions & 0 deletions sandbox.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ type Sandbox interface {
SetKey(key string) error
// Delete destroys this container after detaching it from all connected endpoints.
Delete() error
// Retrieve the interfaces in the sandbox, for restoring checkpointed container
Interfaces() []osl.Interface
Copy link
Contributor

Choose a reason for hiding this comment

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

though Interface is exposed as an osl interface, it feels odd to include it as part of the API.
osl is purely an internal implementation that provides os layer abstraction away from the clients.
Having this interface exposed via Interfaces() API which gives more control over life-cycle of the interface such as Remove makes me uncomfortable.

Lets hear from @mrjana on his opinion.

}

// SandboxOption is a option setter function type used to pass varios options to
Expand Down Expand Up @@ -165,6 +167,14 @@ func (sb *sandbox) Delete() error {
return nil
}

func (sb *sandbox) Interfaces() []osl.Interface {
if sb.osSbox == nil {
return nil
}

return sb.osSbox.Info().Interfaces()
}

func (sb *sandbox) Refresh(options ...SandboxOption) error {
// Store connected endpoints
epList := sb.getConnectedEndpoints()
Expand Down