File tree Expand file tree Collapse file tree 1 file changed +18
-4
lines changed Expand file tree Collapse file tree 1 file changed +18
-4
lines changed Original file line number Diff line number Diff line change @@ -293,17 +293,31 @@ func SetupEnvironmentAndSkipIfNeeded(ctx context.Context, f *framework.Framework
293
293
}
294
294
}
295
295
296
+ func isControlPlaneNode (node v1.Node ) bool {
297
+ _ , isControlPlane := node .Labels ["node-role.kubernetes.io/control-plane" ]
298
+ if isControlPlane {
299
+ framework .Logf ("Node: %q is a control-plane node (label)" , node .Name )
300
+ return true
301
+ }
302
+
303
+ for _ , taint := range node .Spec .Taints {
304
+ if taint .Key == "node-role.kubernetes.io/control-plane" {
305
+ framework .Logf ("Node: %q is a control-plane node (taint)" , node .Name )
306
+ return true
307
+ }
308
+ }
309
+ framework .Logf ("Node: %q is NOT a control-plane node" , node .Name )
310
+ return false
311
+ }
312
+
296
313
func areGPUsAvailableOnAllSchedulableNodes (ctx context.Context , clientSet clientset.Interface ) error {
297
314
framework .Logf ("Getting list of Nodes from API server" )
298
315
nodeList , err := clientSet .CoreV1 ().Nodes ().List (ctx , metav1.ListOptions {})
299
316
if err != nil {
300
317
return fmt .Errorf ("unexpected error getting node list: %w" , err )
301
318
}
302
319
for _ , node := range nodeList .Items {
303
- if node .Spec .Unschedulable {
304
- continue
305
- }
306
- if _ , ok := node .Labels [framework .ControlPlaneLabel ]; ok {
320
+ if node .Spec .Unschedulable || isControlPlaneNode (node ) {
307
321
continue
308
322
}
309
323
framework .Logf ("gpuResourceName %s" , e2egpu .NVIDIAGPUResourceName )
You can’t perform that action at this time.
0 commit comments