VOL-1861: Disable the check for backend bindings.
The check is not required as backends are pre-configured.
This will allow backend references to be re-used on ofagent restarts.
Change-Id: I7520cad7dd2a60cf722244e90674d109679fff93
diff --git a/afrouter/afrouter/binding-router.go b/afrouter/afrouter/binding-router.go
index dd73756..c0ff315 100644
--- a/afrouter/afrouter/binding-router.go
+++ b/afrouter/afrouter/binding-router.go
@@ -102,24 +102,16 @@
return nil
}
log.Debugf("MUST CREATE A NEW BINDING MAP ENTRY!!")
- if len(br.bindings) < len(br.beCluster.backends) {
- if *br.currentBackend, err = br.beCluster.nextBackend(*br.currentBackend, BackendSequenceRoundRobin); err == nil {
- // Use the name of the backend as the metaVal for this new binding
- br.bindings[(*br.currentBackend).name] = *br.currentBackend
- return *br.currentBackend
- } else {
- log.Error(err)
- sl.err = err
- return nil
- }
+ if *br.currentBackend, err = br.beCluster.nextBackend(*br.currentBackend, BackendSequenceRoundRobin); err == nil {
+ // Use the name of the backend as the metaVal for this new binding
+ br.bindings[(*br.currentBackend).name] = *br.currentBackend
+ return *br.currentBackend
} else {
- err = errors.New(fmt.Sprintf("Backends exhausted in attempt to bind for metakey '%s' with value '%s'",
- sl.metaKey, sl.metaVal))
log.Error(err)
sl.err = err
+ return nil
}
}
- return nil
default:
return nil
}