mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-06-29 16:57:18 +00:00
types: remove pid from sandbox state
No longer needed. Signed-off-by: Peng Tao <bergwolf@hyper.sh>
This commit is contained in:
parent
03ee25d4ef
commit
c414599635
@ -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,
|
||||
|
@ -570,7 +570,6 @@ func TestHandlePidNamespace(t *testing.T) {
|
||||
}
|
||||
|
||||
sandbox := &Sandbox{}
|
||||
sandbox.state.Pid = 0
|
||||
|
||||
k := kataAgent{}
|
||||
|
||||
|
@ -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)
|
||||
}
|
||||
|
@ -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"`
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user