@@ -5,7 +5,6 @@ package osde2etests
5
5
6
6
import (
7
7
"context"
8
- "slices"
9
8
"strconv"
10
9
"strings"
11
10
"time"
@@ -247,47 +246,6 @@ var _ = Describe("Managed Cluster Validating Webhooks", Ordered, func() {
247
246
Expect (err ).NotTo (HaveOccurred ())
248
247
}, SpecTimeout (createPodWaitDuration .Seconds ()+ deletePodWaitDuration .Seconds ()))
249
248
250
- It ("prevents operators workloads from being scheduled on worker or master nodes" , func (ctx context.Context ) {
251
- operators := map [string ]string {
252
- "cloud-ingress-operator" : "openshift-cloud-ingress-operator" ,
253
- "configure-alertmanager-operator" : "openshift-monitoring" ,
254
- "custom-domains-operator" : "openshift-custom-domains-operator" ,
255
- "managed-velero-operator" : "openshift-velero" ,
256
- "must-gather-operator" : "openshift-must-gather-operator" ,
257
- "osd-metrics-exporter" : "openshift-osd-metrics" ,
258
- "rbac-permissions-operator" : "openshift-rbac-permissions" ,
259
- }
260
-
261
- var podList v1.PodList
262
- err := client .WithNamespace (metav1 .NamespaceAll ).List (ctx , & podList )
263
- Expect (err ).ShouldNot (HaveOccurred (), "unable to list pods" )
264
- Expect (len (podList .Items )).To (BeNumerically (">" , 0 ), "found no pods" )
265
-
266
- var nodeList v1.NodeList
267
- selectInfraNodes := resources .WithLabelSelector (labels .FormatLabels (map [string ]string {"node-role.kubernetes.io" : "infra" }))
268
- err = client .List (ctx , & nodeList , selectInfraNodes )
269
- Expect (err ).ShouldNot (HaveOccurred (), "unable to list infra nodes " )
270
-
271
- nodeNames := []string {}
272
- for _ , node := range nodeList .Items {
273
- nodeNames = append (nodeNames , node .GetName ())
274
- }
275
-
276
- violators := []string {}
277
- for _ , pod := range podList .Items {
278
- for operator , namespace := range operators {
279
- if pod .GetNamespace () != namespace {
280
- continue
281
- }
282
- if strings .HasPrefix (pod .GetName (), operator ) && ! strings .HasPrefix (pod .GetName (), operator + "-registry" ) {
283
- if ! slices .Contains (nodeNames , pod .Spec .NodeName ) {
284
- violators = append (violators , pod .GetNamespace ()+ "/" + pod .GetName ())
285
- }
286
- }
287
- }
288
- }
289
- Expect (violators ).To (HaveLen (0 ), "found pods in violation %v" , violators )
290
- })
291
249
})
292
250
293
251
Describe ("sre-techpreviewnoupgrade-validation" , func () {
0 commit comments