Skip to content

Commit 0c9c5ce

Browse files
committed
Handle the case where VNI may not exist in dp-service
Network controller needs to react on the non-existence of the VNI and requeue. Signed-off-by: Guvenc Gulce <[email protected]>
1 parent a04d81e commit 0c9c5ce

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

controllers/network_controller.go

+6
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ import (
2020
"context"
2121
"fmt"
2222
"net/netip"
23+
"strconv"
24+
"strings"
2325

2426
"github.com/go-logr/logr"
2527
"github.com/onmetal/controller-utils/clientutils"
@@ -123,6 +125,10 @@ func (r *NetworkReconciler) reconcile(ctx context.Context, log logr.Logger, netw
123125

124126
log.V(1).Info("Creating dpdk default route if not exists")
125127
if err := r.createDefaultRouteIfNotExists(ctx, vni); err != nil {
128+
if strings.Contains(err.Error(), strconv.Itoa(dpdk.ADD_RT_NO_VNI)) {
129+
log.V(1).Info("VNI doesn't exist in dp-service, requeueing")
130+
return ctrl.Result{Requeue: true}, nil
131+
}
126132
return ctrl.Result{}, err
127133
}
128134
log.V(1).Info("Created dpdk default route if not existed")

dpdk/errors.go

+1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ const (
3737
ADD_RT = 250
3838
ADD_RT_FAIL4 = 251
3939
ADD_RT_FAIL6 = 252
40+
ADD_RT_NO_VNI = 253
4041
DEL_RT = 300
4142
ADD_NAT = 350
4243
ADD_NAT_IP_EXISTS = 351

0 commit comments

Comments
 (0)