Skip to content

Add support for hostedCluster to delete all nodePools#13

Merged
openshift-merge-robot merged 1 commit into
openshift:mainfrom
enxebre:delete-nodepools
Feb 3, 2021
Merged

Add support for hostedCluster to delete all nodePools#13
openshift-merge-robot merged 1 commit into
openshift:mainfrom
enxebre:delete-nodepools

Conversation

@enxebre

@enxebre enxebre commented Feb 3, 2021

Copy link
Copy Markdown
Member

Currently when deleting a hostedCluster it won't delete any owned nodePool causing a race between CAPI deleting the underlying machineSets and the nodePool CR wanting to recreate them.

@openshift-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: enxebre

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 3, 2021

@csrwng csrwng left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@enxebre some nits, overall looks good

nodePoolList,
client.MatchingFields{key: value},
); err != nil {
return nil, fmt.Errorf("failed getting machine list: %v", err)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/machine/nodepool/

return ctrl.Result{}, nil
}

func (r *HostedClusterReconciler) listNodePool(key, value string) ([]hyperv1.NodePool, error) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/listNodePool/listNodePools/

},
nodePools, err := r.listNodePool(clusterNameIndexFieldName, req.Name)
if err != nil {
return fmt.Errorf("failed to get nodePools by cluster name: %w", err)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

might be good to include the cluster name in the error message

}
r.Infra = &infra

// index nodePool by clusterName

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Currently when deleting a hostedCluster it won't delete any owned nodePool causing a race between CAPI deleting the underlying machineSets and the nodePool CR wanting to recreate them.
@csrwng

csrwng commented Feb 3, 2021

Copy link
Copy Markdown
Contributor

lgtm

@sjenning

sjenning commented Feb 3, 2021

Copy link
Copy Markdown
Contributor

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Feb 3, 2021
@openshift-merge-robot openshift-merge-robot merged commit d7b33f2 into openshift:main Feb 3, 2021
zanetworker pushed a commit to zanetworker/hypershift that referenced this pull request Sep 28, 2021
Add konnectivity server and agent
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants