mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-06 16:06:51 +00:00
Support pods with containers using host ipc
Add a HostIPC field to the Pod Spec to create containers sharing the same ipc of the host. This feature must be explicitly enabled in apiserver using the option host-ipc-sources. Signed-off-by: Federico Simoncelli <fsimonce@redhat.com>
This commit is contained in:
@@ -2067,3 +2067,20 @@ func TestGetPidMode(t *testing.T) {
|
||||
t.Errorf("expected host pid mode for pod but got %v", pidMode)
|
||||
}
|
||||
}
|
||||
|
||||
func TestGetIPCMode(t *testing.T) {
|
||||
// test false
|
||||
pod := &api.Pod{}
|
||||
ipcMode := getIPCMode(pod, "")
|
||||
|
||||
if ipcMode != "" {
|
||||
t.Errorf("expected empty ipc mode for pod but got %v", ipcMode)
|
||||
}
|
||||
|
||||
// test true
|
||||
pod.Spec.HostIPC = true
|
||||
ipcMode = getIPCMode(pod, "")
|
||||
if ipcMode != "host" {
|
||||
t.Errorf("expected host ipc mode for pod but got %v", ipcMode)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user