Skip to content

Commit db65f1d

Browse files
committed
Add a method to retrieve the interfaces in a sandbox
Signed-off-by: Hui Kang [email protected]
1 parent 614f396 commit db65f1d

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

sandbox.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ type Sandbox interface {
3636
SetKey(key string) error
3737
// Delete destroys this container after detaching it from all connected endpoints.
3838
Delete() error
39+
// Retrieve the interfaces in the sandbox, for restoring checkpointed container
40+
Interfaces() []osl.Interface
3941
}
4042

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

170+
func (sb *sandbox) Interfaces() []osl.Interface {
171+
if sb.osSbox == nil {
172+
return nil
173+
}
174+
175+
return sb.osSbox.Info().Interfaces()
176+
}
177+
168178
func (sb *sandbox) Refresh(options ...SandboxOption) error {
169179
// Store connected endpoints
170180
epList := sb.getConnectedEndpoints()

0 commit comments

Comments
 (0)