types: remove pid from sandbox state

No longer needed.

Signed-off-by: Peng Tao <bergwolf@hyper.sh>
This commit is contained in:
Peng Tao 2019-04-09 01:30:09 -07:00
parent 03ee25d4ef
commit c414599635
4 changed files with 3 additions and 10 deletions

View File

@ -154,8 +154,7 @@ func TestUpdateCgroups(t *testing.T) {
// fake workload
cmd := exec.Command("tail", "-f", "/dev/null")
assert.NoError(cmd.Start())
s.state.Pid = cmd.Process.Pid
s.hypervisor = &mockHypervisor{mockPid: s.state.Pid}
s.hypervisor = &mockHypervisor{mockPid: cmd.Process.Pid}
// no containers
err = s.updateCgroups()
@ -167,7 +166,7 @@ func TestUpdateCgroups(t *testing.T) {
s.containers = map[string]*Container{
"abc": {
process: Process{
Pid: s.state.Pid,
Pid: cmd.Process.Pid,
},
config: &ContainerConfig{
Annotations: containerAnnotations,
@ -175,7 +174,7 @@ func TestUpdateCgroups(t *testing.T) {
},
"xyz": {
process: Process{
Pid: s.state.Pid,
Pid: cmd.Process.Pid,
},
config: &ContainerConfig{
Annotations: containerAnnotations,

View File

@ -570,7 +570,6 @@ func TestHandlePidNamespace(t *testing.T) {
}
sandbox := &Sandbox{}
sandbox.state.Pid = 0
k := kataAgent{}

View File

@ -1009,7 +1009,6 @@ func (s *Sandbox) addContainer(c *Container) error {
ann := c.GetAnnotations()
if ann[annotations.ContainerTypeKey] == string(PodSandbox) {
s.state.Pid = c.process.Pid
s.state.CgroupPath = c.state.CgroupPath
return s.store.Store(store.State, s.state)
}

View File

@ -34,10 +34,6 @@ type SandboxState struct {
// Index of the block device passed to hypervisor.
BlockIndex int `json:"blockIndex"`
// Pid is the process id of the sandbox container which is the first
// container to be started.
Pid int `json:"pid"`
// GuestMemoryBlockSizeMB is the size of memory block of guestos
GuestMemoryBlockSizeMB uint32 `json:"guestMemoryBlockSize"`