From 1afa7971f2c429340f28733f1dfbc13cbaef5c67 Mon Sep 17 00:00:00 2001 From: ramr Date: Mon, 13 Aug 2018 14:50:59 -0700 Subject: [PATCH] Use the cloned blueprint with the correct blueprint namespace in add/remove/provision - sorta works but the route namespaces are off and creates cleanup issues. fixes bugz #1614727 --- pkg/router/template/configmanager/haproxy/manager.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/router/template/configmanager/haproxy/manager.go b/pkg/router/template/configmanager/haproxy/manager.go index 7f687c7bb59e..f0e9ebad87af 100644 --- a/pkg/router/template/configmanager/haproxy/manager.go +++ b/pkg/router/template/configmanager/haproxy/manager.go @@ -214,7 +214,7 @@ func (cm *haproxyConfigManager) AddBlueprint(route *routeapi.Route) { newRoute.Spec.Host = r.Spec.Host if !reflect.DeepEqual(r, newRoute) { updated = true - blueprints = append(blueprints, route.DeepCopy()) + blueprints = append(blueprints, newRoute) continue } } @@ -222,7 +222,7 @@ func (cm *haproxyConfigManager) AddBlueprint(route *routeapi.Route) { } if !routeExists { - blueprints = append(blueprints, route.DeepCopy()) + blueprints = append(blueprints, newRoute) updated = true } @@ -234,7 +234,7 @@ func (cm *haproxyConfigManager) AddBlueprint(route *routeapi.Route) { cm.blueprintRoutes = blueprints cm.lock.Unlock() - cm.provisionRoutePool(route) + cm.provisionRoutePool(newRoute) } // RemoveBlueprint removes a route blueprint. @@ -264,7 +264,7 @@ func (cm *haproxyConfigManager) RemoveBlueprint(route *routeapi.Route) { cm.blueprintRoutes = blueprints cm.lock.Unlock() - cm.removeRoutePool(route) + cm.removeRoutePool(deletedRoute) } // Register registers an id with an expected haproxy backend for a route.