Merge pull request #9782 from kinvolk/rata/userns-update-podSandboxStatus
Include userns info in cri/server PodSandboxStatus
This commit is contained in:
commit
9b2313711b
@ -134,11 +134,7 @@ func toCRISandboxStatus(meta sandboxstore.Metadata, status string, createdAt tim
|
|||||||
},
|
},
|
||||||
Linux: &runtime.LinuxPodSandboxStatus{
|
Linux: &runtime.LinuxPodSandboxStatus{
|
||||||
Namespaces: &runtime.Namespace{
|
Namespaces: &runtime.Namespace{
|
||||||
Options: &runtime.NamespaceOption{
|
Options: nsOpts,
|
||||||
Network: nsOpts.GetNetwork(),
|
|
||||||
Pid: nsOpts.GetPid(),
|
|
||||||
Ipc: nsOpts.GetIpc(),
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
Labels: meta.Config.GetLabels(),
|
Labels: meta.Config.GetLabels(),
|
||||||
|
@ -31,6 +31,13 @@ func TestPodSandboxStatus(t *testing.T) {
|
|||||||
id = "test-id"
|
id = "test-id"
|
||||||
ip = "10.10.10.10"
|
ip = "10.10.10.10"
|
||||||
)
|
)
|
||||||
|
idmap := []*runtime.IDMapping{
|
||||||
|
{
|
||||||
|
ContainerId: 0,
|
||||||
|
HostId: 100,
|
||||||
|
Length: 1,
|
||||||
|
},
|
||||||
|
}
|
||||||
additionalIPs := []string{"8.8.8.8", "2001:db8:85a3::8a2e:370:7334"}
|
additionalIPs := []string{"8.8.8.8", "2001:db8:85a3::8a2e:370:7334"}
|
||||||
createdAt := time.Now()
|
createdAt := time.Now()
|
||||||
config := &runtime.PodSandboxConfig{
|
config := &runtime.PodSandboxConfig{
|
||||||
@ -46,6 +53,11 @@ func TestPodSandboxStatus(t *testing.T) {
|
|||||||
Network: runtime.NamespaceMode_NODE,
|
Network: runtime.NamespaceMode_NODE,
|
||||||
Pid: runtime.NamespaceMode_CONTAINER,
|
Pid: runtime.NamespaceMode_CONTAINER,
|
||||||
Ipc: runtime.NamespaceMode_POD,
|
Ipc: runtime.NamespaceMode_POD,
|
||||||
|
UsernsOptions: &runtime.UserNamespace{
|
||||||
|
Uids: idmap,
|
||||||
|
Gids: idmap,
|
||||||
|
Mode: runtime.NamespaceMode_POD,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -80,6 +92,11 @@ func TestPodSandboxStatus(t *testing.T) {
|
|||||||
Network: runtime.NamespaceMode_NODE,
|
Network: runtime.NamespaceMode_NODE,
|
||||||
Pid: runtime.NamespaceMode_CONTAINER,
|
Pid: runtime.NamespaceMode_CONTAINER,
|
||||||
Ipc: runtime.NamespaceMode_POD,
|
Ipc: runtime.NamespaceMode_POD,
|
||||||
|
UsernsOptions: &runtime.UserNamespace{
|
||||||
|
Uids: idmap,
|
||||||
|
Gids: idmap,
|
||||||
|
Mode: runtime.NamespaceMode_POD,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user