kubernetes-sigs/cluster-api-provider-openstack

cluster delete with LB: network is removed too soon

Opened this issue · 1 comments

/kind bug

What steps did you take and what happened:

Currently, if the loadbalancer is enabled and someone tries to remove the cluster, they'll likely have this error:

controller.go:329] "Reconciler error" err=<
failed to delete network: Expected HTTP response code [202 204] when accessing [DELETE http://10.0.3.15:9696/networking/v2.0/networks/0e5e0e93-5784-4b22-9f7c-0e8d6bfc1337], but got 409 instead
{"NeutronError": {"type": "NetworkInUse", "message": "Unable to complete operation on network 0e5e0e93-5784-4b22-9f7c-0e8d6bfc1337. There are one or more ports still in use on the network, id for these ports is: de51d5a2-5e16-4873-8e46-a0637d4bc5bc.", "detail": ""}}
 > controller="openstackcluster" controllerGroup="infrastructure.cluster.x-k8s.io" controllerKind="OpenStackCluster" OpenStackCluster="e2e-whn9ya/cluster-e2e-whn9ya" namespace="e2e-whn9ya" name="cluster-e2e-whn9ya" reconcileID="4155da75-0205-4d52-91ef-9d77fb76979f"

https://storage.googleapis.com/kubernetes-jenkins/pr-logs/pull/kubernetes-sigs_cluster-api-provider-openstack/2099/pull-cluster-api-provider-openstack-e2e-test/1799085067255943168/artifacts/clusters/bootstrap/logs/capo-system/capo-controller-manager/capo-controller-manager-7d957cb6cd-kndmz/manager.log

It's ok because we reconcile later and eventually the ports managed by Octavia are getting removed by Octavia but we could reconcile with a wait to let Octavia a chance to remove the ports itself and avoid this error message which can be confused to our users.

What did you expect to happen:

No errors in the logs.

I'm trying to see if doing #2122 will also fix this bug (probably not).