func GetMachineFromNode(client *metalgo.Driver, nodeName types.NodeName) (*models.V1MachineResponse, error) {
	machineHostname := string(nodeName)
	// if strings.HasPrefix(machineHostname, "kind-worker") {
	// 	return getTestMachine(client)
	// }

	mfr := &metalgo.MachineFindRequest{
		AllocationHostname: &machineHostname,
	}
	machines, err := client.MachineFind(mfr)
	if err != nil {
		return nil, err
	}
	if len(machines.Machines) == 0 {
		return nil, fmt.Errorf("no machine with name %q found", nodeName)
	}
	if len(machines.Machines) > 1 {
		return nil, fmt.Errorf("more than one (%d) machine with name %q found", len(machines.Machines), nodeName)
	}

	return machines.Machines[0], nil
}
// GetMachineFromNode returns a machine where hostname matches the kubernetes node.Name.
GetMachineFromNode returns a machine where hostname matches the kubernetes node.Name.
// GetMachineFromNode returns a machine where hostname matches the kubernetes node . Name .
func GetMachineFromNode(client *metalgo.Driver, nodeName types.NodeName) (*models.V1MachineResponse, error) {
	machineHostname := string(nodeName)
	mfr := &metalgo.MachineFindRequest{
		AllocationHostname: &machineHostname,
	}
	machines, err := client.MachineFind(mfr)
	if err != nil {
		return nil, err
	}
	if len(machines.Machines) == 0 {
		return nil, fmt.Errorf("no machine with name %q found", nodeName)
	}
	if len(machines.Machines) > 1 {
		return nil, fmt.Errorf("more than one (%d) machine with name %q found", len(machines.Machines), nodeName)
	}
	return machines.Machines[0], nil
}
func GetMachineFromNode ( client * metalgo . Driver , nodeName types . NodeName ) ( * models . V1MachineResponse , error ) { machineHostname := string ( nodeName ) mfr := & metalgo . MachineFindRequest { AllocationHostname : & machineHostname , } machines , err := client . MachineFind ( mfr ) if err != nil { return nil , err } if len ( machines . Machines ) == 0 { return nil , fmt . Errorf ( " " , nodeName ) } if len ( machines . Machines ) > 1 { return nil , fmt . Errorf ( " " , len ( machines . Machines ) , nodeName ) } return machines . Machines [ 0 ] , nil }
GetMachineFromNode returns a machine where hostname matches the kubernetes node.Name.
GetMachineFromNode returns a machine where hostname matches the kubernetes node . Name .
// if strings.HasPrefix(machineHostname, "kind-worker") { // 	return getTestMachine(client) // }