forked from kata-containers/runtime
-
Notifications
You must be signed in to change notification settings - Fork 0
/
container.go
44 lines (36 loc) · 1.04 KB
/
container.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
// Copyright (c) 2017 Intel Corporation
//
// SPDX-License-Identifier: Apache-2.0
//
package vcmock
import (
vc "github.com/kata-containers/runtime/virtcontainers"
)
// ID implements the VCContainer function of the same name.
func (c *Container) ID() string {
return c.MockID
}
// Sandbox implements the VCContainer function of the same name.
func (c *Container) Sandbox() vc.VCSandbox {
return c.MockSandbox
}
// Process implements the VCContainer function of the same name.
func (c *Container) Process() vc.Process {
// always return a mockprocess with a non-zero Pid
if c.MockProcess.Pid == 0 {
c.MockProcess.Pid = 1000
}
return c.MockProcess
}
// GetToken implements the VCContainer function of the same name.
func (c *Container) GetToken() string {
return c.MockToken
}
// GetPid implements the VCContainer function of the same name.
func (c *Container) GetPid() int {
return c.MockPid
}
// GetAnnotations implements the VCContainer function of the same name.
func (c *Container) GetAnnotations() map[string]string {
return c.MockAnnotations
}