@@ -398,29 +398,6 @@ func fetchIntelMachineBindingFromCluster(ctx context.Context, s *Server, namespa
398398 return nil , fmt .Errorf ("machine not found for node ID %s" , nodeID )
399399}
400400
401- func fetchMachine (ctx context.Context , s * Server , namespace string , clusterName string , enUUID string ) (* capi.Machine , error ) {
402- unstructuredMachines , err := s .k8sclient .Resource (core .MachineResourceSchema ).Namespace (namespace ).List (ctx , v1.ListOptions {
403- LabelSelector : ClusterNameSelectorKey + "=" + clusterName ,
404- })
405- if unstructuredMachines == nil || len (unstructuredMachines .Items ) == 0 {
406- return nil , fmt .Errorf ("machine not found for en UUID %s" , enUUID )
407- }
408- if err != nil {
409- return nil , err
410- }
411- machines , err := convertUnsructuredtoMachine (unstructuredMachines )
412- if err != nil {
413- return nil , err
414- }
415- for _ , machine := range machines {
416- nodeInfo := machine .Status .NodeInfo
417- if nodeInfo != nil && nodeInfo .SystemUUID == enUUID {
418- return machine , nil
419- }
420- }
421- return nil , fmt .Errorf ("machine not found for en UUID %s" , enUUID )
422- }
423-
424401func fetchMachinesList (ctx context.Context , s * Server , namespace string , clusterName string ) ([]unstructured.Unstructured , error ) {
425402 unstructuredMachineList , err := s .k8sclient .Resource (core .MachineResourceSchema ).Namespace (namespace ).List (ctx , v1.ListOptions {
426403 LabelSelector : ClusterNameSelectorKey + "=" + clusterName ,
0 commit comments