/
types.go
128 lines (90 loc) · 3.04 KB
/
types.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
package types
import (
pouchtypes "github.com/alibaba/pouch/apis/types"
runtime "github.com/alibaba/pouch/cri/apis/v1alpha2"
)
// Container represents the container's meta data.
type Container struct {
// app armor profile
AppArmorProfile string `json:"AppArmorProfile,omitempty"`
// seccomp profile
SeccompProfile string `json:"SeccompProfile,omitempty"`
// no new privileges
NoNewPrivileges bool `json:"NoNewPrivileges,omitempty"`
// The arguments to the command being run
Args []string `json:"Args"`
// config
Config *pouchtypes.ContainerConfig `json:"Config,omitempty"`
// The time the container was created
Created string `json:"Created,omitempty"`
// driver
Driver string `json:"Driver,omitempty"`
// exec ids
ExecIds string `json:"ExecIDs,omitempty"`
// Snapshotter, GraphDriver is same, keep both
// just for compatibility
// snapshotter informations of container
Snapshotter *pouchtypes.SnapshotterData `json:"Snapshotter,omitempty"`
// graph driver
GraphDriver *pouchtypes.GraphDriverData `json:"GraphDriver,omitempty"`
// host config
HostConfig *pouchtypes.HostConfig `json:"HostConfig,omitempty"`
// hostname path
HostnamePath string `json:"HostnamePath,omitempty"`
// hosts path
HostsPath string `json:"HostsPath,omitempty"`
// The ID of the container
ID string `json:"Id,omitempty"`
// The container's image
Image string `json:"Image,omitempty"`
// log path
LogPath string `json:"LogPath,omitempty"`
// mount label
MountLabel string `json:"MountLabel,omitempty"`
// mounts
Mounts []*pouchtypes.MountPoint `json:"Mounts"`
// name
Name string `json:"Name,omitempty"`
// network settings
NetworkSettings *pouchtypes.NetworkSettings `json:"NetworkSettings,omitempty"`
Node interface{} `json:"Node,omitempty"`
// The path to the command being run
Path string `json:"Path,omitempty"`
// process label
ProcessLabel string `json:"ProcessLabel,omitempty"`
// resolv conf path
ResolvConfPath string `json:"ResolvConfPath,omitempty"`
// restart count
RestartCount int64 `json:"RestartCount,omitempty"`
// The total size of all the files in this container.
SizeRootFs int64 `json:"SizeRootFs,omitempty"`
// The size of files that have been created or changed by this container.
SizeRw int64 `json:"SizeRw,omitempty"`
// state
State *pouchtypes.ContainerState `json:"State,omitempty"`
// BaseFS
BaseFS string `json:"BaseFS,omitempty"`
// Escape keys for detach
DetachKeys string
// Specify if the container is taken over by pouch,
// or just created by pouch
RootFSProvided bool
}
// SandboxMeta represents the sandbox's meta data.
// copy from github.com/alibaba/pouch/cri/v1alpha2/cri_types.go
type SandboxMeta struct {
// ID is the id of sandbox.
ID string
// Config is CRI sandbox config.
Config *runtime.PodSandboxConfig
// Runtime is the runtime of sandbox
Runtime string
// Runtime whether to enable lxcfs for a container
LxcfsEnabled bool
// NetNS is the sandbox's network namespace
NetNS string
}
// Key returns sandbox's id.
func (meta *SandboxMeta) Key() string {
return meta.ID
}