Skip to content

Commit

Permalink
(fix chainsaw test): hostNetwork must be true if any container has ho…
Browse files Browse the repository at this point in the history
…stProcess set to true and if any container has hostProcess set to true all the containers must have it too (see comment for the error that would be generated otherwise)

[spec: Invalid value: "": If pod contains any hostProcess containers then all containers must be HostProcess containers, spec.hostNetwork: Invalid value: false: hostNetwork must be true if pod contains any hostProcess containers]

Signed-off-by: Chandan-DK <[email protected]>
  • Loading branch information
Chandan-DK committed Aug 24, 2024
1 parent ac409d9 commit 2a12958
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ kind: Pod
metadata:
name: badpod01-new
spec:
hostNetwork: true
initContainers:
- name: busybox01-init
image: busybox:1.35
Expand All @@ -14,15 +15,19 @@ spec:
image: busybox:1.35
securityContext:
windowsOptions:
hostProcess: false
hostProcess: true
- name: busybox02
image: busybox:1.35
securityContext:
windowsOptions:
hostProcess: true
---
apiVersion: v1
kind: Pod
metadata:
name: badpod02-new
spec:
hostNetwork: true
containers:
- name: busybox01
image: busybox:1.35
Expand All @@ -35,6 +40,7 @@ kind: Pod
metadata:
name: badpod03-new
spec:
hostNetwork: true
containers:
- name: busybox01
image: busybox:1.35
Expand All @@ -43,6 +49,9 @@ spec:
hostProcess: true
- name: busybox02
image: busybox:1.35
securityContext:
windowsOptions:
hostProcess: true
---
apiVersion: v1
kind: Pod
Expand Down

0 comments on commit 2a12958

Please sign in to comment.