Skip to content

Commit efbeb27

Browse files
authored
Merge pull request #708 from alvaroaleman/envtest-allow-privileged
🐛 Envtest: Allow creating objects with privileged container specs
2 parents 158b897 + a93c9c3 commit efbeb27

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

pkg/controller/controller_integration_test.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,9 @@ var _ = Describe("controller", func() {
100100
{
101101
Name: "nginx",
102102
Image: "nginx",
103+
SecurityContext: &corev1.SecurityContext{
104+
Privileged: truePtr(),
105+
},
103106
},
104107
},
105108
},
@@ -168,3 +171,8 @@ var _ = Describe("controller", func() {
168171
}, 5)
169172
})
170173
})
174+
175+
func truePtr() *bool {
176+
t := true
177+
return &t
178+
}

pkg/envtest/server.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ var DefaultKubeAPIServerFlags = []string{
8484
"--secure-port={{ if .SecurePort }}{{ .SecurePort }}{{ end }}",
8585
"--admission-control=AlwaysAdmit",
8686
"--service-cluster-ip-range=10.0.0.0/24",
87+
"--allow-privileged=true",
8788
}
8889

8990
// Environment creates a Kubernetes test environment that will start / stop the Kubernetes control plane and

0 commit comments

Comments
 (0)