diff --git a/hypershift-operator/controllers/nodepool/nodepool_controller.go b/hypershift-operator/controllers/nodepool/nodepool_controller.go index 8d4a1acaebe..8e1c878743c 100644 --- a/hypershift-operator/controllers/nodepool/nodepool_controller.go +++ b/hypershift-operator/controllers/nodepool/nodepool_controller.go @@ -1799,7 +1799,7 @@ func (r *NodePoolReconciler) listMachineSets(nodePool *hyperv1.NodePool) ([]clie } default: // need a default path that returns a value that does not cause the hypershift operator to crash - // if no explicit machineTemplate is defined safe to assume none exist + // if no explicit machineSet is defined safe to assume none exist return nil, nil } machineSetList.SetGroupVersionKind(schema.GroupVersionKind{ @@ -1811,9 +1811,9 @@ func (r *NodePoolReconciler) listMachineSets(nodePool *hyperv1.NodePool) ([]clie return nil, fmt.Errorf("failed to list MachineSets: %w", err) } var filtered []client.Object - for i, machineTemplate := range machineSetList.Items { - if machineTemplate.GetAnnotations() != nil { - if annotation, ok := machineTemplate.GetAnnotations()[nodePoolAnnotation]; ok && + for i, machineSet := range machineSetList.Items { + if machineSet.GetAnnotations() != nil { + if annotation, ok := machineSet.GetAnnotations()[nodePoolAnnotation]; ok && annotation == client.ObjectKeyFromObject(nodePool).String() { filtered = append(filtered, &machineSetList.Items[i]) }