Skip to content

Commit

Permalink
fixed other capoerrors
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiasgiese committed Jul 12, 2021
1 parent 222ec42 commit baafaef
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions pkg/cloud/services/compute/instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -707,12 +707,12 @@ func (s *Service) deleteAttachInterface(eventObject runtime.Object, instanceID,

mc := metrics.NewMetricPrometheusContext("router_interface", "delete")
err = attachinterfaces.Delete(s.computeClient, instanceID, portID).ExtractErr()
if mc.ObserveRequest(err) != nil {
if err != nil {
if capoerrors.IsNotFound(err) {
return nil
}
record.Warnf(eventObject, "FailedDeleteAttachInterface", "Failed to delete attach interface: instance %s, port %s: %v", instance.ID, port.ID, err)
return err
return mc.ObserveRequest(err)
}

record.Eventf(eventObject, "SuccessfulDeleteAttachInterface", "Deleted attach interface: instance %s, port %s", instance.ID, port.ID)
Expand Down
4 changes: 2 additions & 2 deletions pkg/cloud/services/networking/router.go
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,8 @@ func (s *Service) DeleteRouter(openStackCluster *infrav1.OpenStackCluster, clust
_, err = routers.RemoveInterface(s.client, router.ID, routers.RemoveInterfaceOpts{
SubnetID: subnet.ID,
}).Extract()
if mc.ObserveRequest(err) != nil {
if !capoerrors.IsNotFound(err) {
if err != nil {
if !capoerrors.IsNotFound(mc.ObserveRequest(err)) {
return fmt.Errorf("unable to remove router interface: %v", err)
}
s.logger.V(4).Info("Router Interface already removed, nothing to do", "id", router.ID)
Expand Down

0 comments on commit baafaef

Please sign in to comment.