mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-06-30 09:13:29 +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
|
// fake workload
|
||||||
cmd := exec.Command("tail", "-f", "/dev/null")
|
cmd := exec.Command("tail", "-f", "/dev/null")
|
||||||
assert.NoError(cmd.Start())
|
assert.NoError(cmd.Start())
|
||||||
s.state.Pid = cmd.Process.Pid
|
s.hypervisor = &mockHypervisor{mockPid: cmd.Process.Pid}
|
||||||
s.hypervisor = &mockHypervisor{mockPid: s.state.Pid}
|
|
||||||
|
|
||||||
// no containers
|
// no containers
|
||||||
err = s.updateCgroups()
|
err = s.updateCgroups()
|
||||||
@ -167,7 +166,7 @@ func TestUpdateCgroups(t *testing.T) {
|
|||||||
s.containers = map[string]*Container{
|
s.containers = map[string]*Container{
|
||||||
"abc": {
|
"abc": {
|
||||||
process: Process{
|
process: Process{
|
||||||
Pid: s.state.Pid,
|
Pid: cmd.Process.Pid,
|
||||||
},
|
},
|
||||||
config: &ContainerConfig{
|
config: &ContainerConfig{
|
||||||
Annotations: containerAnnotations,
|
Annotations: containerAnnotations,
|
||||||
@ -175,7 +174,7 @@ func TestUpdateCgroups(t *testing.T) {
|
|||||||
},
|
},
|
||||||
"xyz": {
|
"xyz": {
|
||||||
process: Process{
|
process: Process{
|
||||||
Pid: s.state.Pid,
|
Pid: cmd.Process.Pid,
|
||||||
},
|
},
|
||||||
config: &ContainerConfig{
|
config: &ContainerConfig{
|
||||||
Annotations: containerAnnotations,
|
Annotations: containerAnnotations,
|
||||||
|
@ -570,7 +570,6 @@ func TestHandlePidNamespace(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
sandbox := &Sandbox{}
|
sandbox := &Sandbox{}
|
||||||
sandbox.state.Pid = 0
|
|
||||||
|
|
||||||
k := kataAgent{}
|
k := kataAgent{}
|
||||||
|
|
||||||
|
@ -1009,7 +1009,6 @@ func (s *Sandbox) addContainer(c *Container) error {
|
|||||||
|
|
||||||
ann := c.GetAnnotations()
|
ann := c.GetAnnotations()
|
||||||
if ann[annotations.ContainerTypeKey] == string(PodSandbox) {
|
if ann[annotations.ContainerTypeKey] == string(PodSandbox) {
|
||||||
s.state.Pid = c.process.Pid
|
|
||||||
s.state.CgroupPath = c.state.CgroupPath
|
s.state.CgroupPath = c.state.CgroupPath
|
||||||
return s.store.Store(store.State, s.state)
|
return s.store.Store(store.State, s.state)
|
||||||
}
|
}
|
||||||
|
@ -34,10 +34,6 @@ type SandboxState struct {
|
|||||||
// Index of the block device passed to hypervisor.
|
// Index of the block device passed to hypervisor.
|
||||||
BlockIndex int `json:"blockIndex"`
|
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 is the size of memory block of guestos
|
||||||
GuestMemoryBlockSizeMB uint32 `json:"guestMemoryBlockSize"`
|
GuestMemoryBlockSizeMB uint32 `json:"guestMemoryBlockSize"`
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user