@@ -108,7 +108,7 @@ var _ = Describe("Managed Cluster Validating Webhooks", Ordered, func() {
108
108
It ("should create a pod with the correct security context" , func () {
109
109
pod := & v1.Pod {
110
110
ObjectMeta : metav1.ObjectMeta {
111
- Name : managedClusterValidationWebhookPodName ,
111
+ Name : "testpod" ,
112
112
},
113
113
Spec : v1.PodSpec {
114
114
Containers : []v1.Container {
@@ -135,7 +135,7 @@ var _ = Describe("Managed Cluster Validating Webhooks", Ordered, func() {
135
135
Expect (err ).NotTo (HaveOccurred ())
136
136
})
137
137
138
- // Helper function to create a pointer to a bool
138
+
139
139
func boolPtr (b bool ) * bool {
140
140
return & b
141
141
}
@@ -161,18 +161,17 @@ var _ = Describe("Managed Cluster Validating Webhooks", Ordered, func() {
161
161
Containers : []v1.Container {
162
162
{
163
163
Name : "test" ,
164
- Image : "registry.access.redhat.com/ubi8/ubi-minimal" ,
165
- },
166
- },
167
- Tolerations : []v1.Toleration {
168
- {
169
- Key : "node-role.kubernetes.io/master" ,
170
- Value : "toleration-key-value" ,
171
- Effect : v1 .TaintEffectNoSchedule ,
172
- }, {
173
- Key : "node-role.kubernetes.io/infra" ,
174
- Value : "toleration-key-value2" ,
175
- Effect : v1 .TaintEffectNoSchedule ,
164
+ Image : "quay.io/jitesoft/nginx:mainline" ,
165
+ SecurityContext : & v1.SecurityContext {
166
+ AllowPrivilegeEscalation : boolPtr (false ),
167
+ Capabilities : & v1.Capabilities {
168
+ Drop : []v1.Capability {"ALL" },
169
+ },
170
+ RunAsNonRoot : boolPtr (true ),
171
+ SeccompProfile : & v1.SeccompProfile {
172
+ Type : v1 .SeccompProfileTypeRuntimeDefault ,
173
+ },
174
+ },
176
175
},
177
176
},
178
177
},
@@ -200,7 +199,7 @@ var _ = Describe("Managed Cluster Validating Webhooks", Ordered, func() {
200
199
201
200
err := client .Get (ctx , saName , namespaceName , sa )
202
201
203
- if err == nil {
202
+ if ( err == nil ) {
204
203
err = client .Delete (ctx , sa )
205
204
Expect (err ).ToNot (HaveOccurred (), "Failed to delete existing Service Account" )
206
205
}
0 commit comments