Skip to content

Commit

Permalink
Merge pull request #2191 from gravitl/GRA-1513-ingress
Browse files Browse the repository at this point in the history
don't fail deleting ingress if no extclients exist
  • Loading branch information
0xdcarns authored Apr 12, 2023
2 parents 382da9d + 3711c1e commit 7c3ab41
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions logic/gateway.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,16 +140,8 @@ func DeleteIngressGateway(networkName string, nodeid string) (models.Node, bool,
if err != nil {
return models.Node{}, false, removedClients, err
}
//host, err := GetHost(node.ID.String())
//if err != nil {
//return models.Node{}, false, err
//}
//network, err := GetParentNetwork(networkName)
if err != nil {
return models.Node{}, false, removedClients, err
}
clients, err := GetExtClientsByID(nodeid, networkName)
if err != nil {
if err != nil && !database.IsEmptyRecord(err) {
return models.Node{}, false, removedClients, err
}

Expand Down Expand Up @@ -190,7 +182,10 @@ func DeleteIngressGateway(networkName string, nodeid string) (models.Node, bool,
// DeleteGatewayExtClients - deletes ext clients based on gateway (mac) of ingress node and network
func DeleteGatewayExtClients(gatewayID string, networkName string) error {
currentExtClients, err := GetNetworkExtClients(networkName)
if err != nil && !database.IsEmptyRecord(err) {
if database.IsEmptyRecord(err) {
return nil
}
if err != nil {
return err
}
for _, extClient := range currentExtClients {
Expand Down

0 comments on commit 7c3ab41

Please sign in to comment.