From 7ad74e069e58aa2eaa60390de9620f3593ebc0b1 Mon Sep 17 00:00:00 2001 From: ramr Date: Mon, 6 Aug 2018 16:16:55 -0700 Subject: [PATCH] Fix for router with dynamic config changes not reloading - need to simulate an actual change otherwise router commit doesn't call reload. And address @mfojtik review comments. fixes bugz #1612019 --- pkg/router/template/configmanager/haproxy/manager.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pkg/router/template/configmanager/haproxy/manager.go b/pkg/router/template/configmanager/haproxy/manager.go index 55ccbe5ddb7f..03eec98370c0 100644 --- a/pkg/router/template/configmanager/haproxy/manager.go +++ b/pkg/router/template/configmanager/haproxy/manager.go @@ -658,11 +658,12 @@ func (cm *haproxyConfigManager) commitRouterConfig() { cm.commitTimer = nil cm.lock.Unlock() - // [Re]Adding a blueprint pool route triggers a router state change. - // And calling Commit ensures that the config gets written out. + // Adding (+removing) a new blueprint pool route triggers a router state + // change. And calling Commit ensures that the config gets written out. route := createBlueprintRoute(routeapi.TLSTerminationEdge) - route.Name = fmt.Sprintf("%v-1", route.Name) + route.Name = fmt.Sprintf("%s-temp-%d", route.Name, time.Now().Unix()) cm.router.AddRoute(route) + cm.router.RemoveRoute(route) glog.V(4).Infof("Committing associated template router ... ") cm.router.Commit()