Skip to content

Commit

Permalink
Merge pull request openshift#15 from enxebre/fix-delete-cluster
Browse files Browse the repository at this point in the history
Fetch nodePool by clusterName
  • Loading branch information
openshift-merge-robot authored Feb 8, 2021
2 parents 0111445 + 1265a4f commit 054191c
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ func (r *HostedClusterReconciler) listNodePools(clusterNamespace, clusterName st
// TODO: do a label association or something
filtered := []hyperv1.NodePool{}
for i, nodePool := range nodePoolList.Items {
if nodePool.Namespace == clusterNamespace && nodePool.Name == clusterName {
if nodePool.Namespace == clusterNamespace && nodePool.Spec.ClusterName == clusterName {
filtered = append(filtered, nodePoolList.Items[i])
}
}
Expand All @@ -330,7 +330,7 @@ func (r *HostedClusterReconciler) delete(ctx context.Context, req ctrl.Request)

for key := range nodePools {
if err := r.Delete(ctx, &nodePools[key]); err != nil && !apierrors.IsNotFound(err) {
return fmt.Errorf("failed to delete defaultNodePool: %w", err)
return fmt.Errorf("failed to delete nodePool %q for cluster %q: %w", nodePools[key].GetName(), req.Name, err)
}
}

Expand Down

0 comments on commit 054191c

Please sign in to comment.