@@ -72,6 +72,8 @@ const f5VsWAFPolicy = "virtual-server.f5.com/waf"
7272
7373type ResourceMap map [int32 ][]* ResourceConfig
7474
75+ type RouteMap map [string ]* routeapi.Route
76+
7577type Manager struct {
7678 resources * Resources
7779 customProfiles * CustomProfileStore
@@ -145,7 +147,12 @@ type Manager struct {
145147 WatchedNS WatchedNamespaces
146148 as3RouteCfg ActiveAS3Route
147149 As3SchemaLatest string
148- intF5Res InternalF5Resources // AS3 Specific features that can be applied to a Route/Ingress
150+ intF5Res InternalF5ResourcesGroup // AS3 Specific features that can be applied to a Route/Ingress
151+ // Path of schemas reside locally
152+ SchemaLocalPath string
153+ // Flag to check schema validation using reference or string
154+ As3SchemaFlag bool
155+ RoutesProcessed RouteMap // Processed routes for updating Admit Status
149156}
150157
151158// FIXME: Refactor to have one struct to hold all AS3 specific data.
@@ -193,6 +200,7 @@ type Params struct {
193200 SSLInsecure bool
194201 TrustedCertsCfgmap string
195202 Agent string
203+ SchemaLocalPath string
196204}
197205
198206// Configuration options for Routes in OpenShift
@@ -248,6 +256,8 @@ func NewManager(params *Params) *Manager {
248256 sslInsecure : params .SSLInsecure ,
249257 trustedCertsCfgmap : params .TrustedCertsCfgmap ,
250258 Agent : getValidAgent (params .Agent ),
259+ intF5Res : make (map [string ]InternalF5Resources ),
260+ SchemaLocalPath : params .SchemaLocal ,
251261 }
252262 if nil != manager .kubeClient && nil == manager .restClientv1 {
253263 // This is the normal production case, but need the checks for unit tests.
@@ -439,7 +449,6 @@ func (appMgr *Manager) syncNamespace(nsName string) error {
439449 appMgr .removeNamespaceLocked (nsName )
440450 appMgr .eventNotifier .deleteNotifierForNamespace (nsName )
441451 appMgr .resources .Lock ()
442- defer appMgr .resources .Unlock ()
443452 rsDeleted := 0
444453 appMgr .resources .ForEach (func (key serviceKey , cfg * ResourceConfig ) {
445454 if key .Namespace == nsName {
@@ -448,8 +457,9 @@ func (appMgr *Manager) syncNamespace(nsName string) error {
448457 }
449458 }
450459 })
460+ appMgr .resources .Unlock ()
451461 if rsDeleted > 0 {
452- appMgr .outputConfigLocked ()
462+ appMgr .outputConfig ()
453463 }
454464 }
455465
@@ -1353,6 +1363,7 @@ func (appMgr *Manager) syncRoutes(
13531363 appInf * appInformer ,
13541364 dgMap InternalDataGroupMap ,
13551365) error {
1366+ appMgr .RoutesProcessed = make (RouteMap )
13561367 routeByIndex , err := appInf .getOrderedRoutes (sKey .Namespace )
13571368 if nil != err {
13581369 log .Warningf ("Unable to list routes for namespace '%v': %v" ,
@@ -1364,13 +1375,13 @@ func (appMgr *Manager) syncRoutes(
13641375 svcFwdRulesMap := NewServiceFwdRuleMap ()
13651376
13661377 // buffer to hold F5Resources till all routes are processed
1367- bufferF5Res := map [ Record ] F5Resources {}
1378+ bufferF5Res := InternalF5Resources {}
13681379
13691380 for _ , route := range routeByIndex {
13701381 if route .ObjectMeta .Namespace != sKey .Namespace {
13711382 continue
13721383 }
1373- RoutesProcessed = append ( RoutesProcessed , route )
1384+ appMgr . RoutesProcessed [ route . ObjectMeta . Name ] = route
13741385
13751386 //FIXME(kenr): why do we process services that aren't associated
13761387 // with a route?
@@ -1521,8 +1532,10 @@ func (appMgr *Manager) syncRoutes(
15211532 }
15221533
15231534 // if buffer is updated then update the appMgr and stats
1524- if ! reflect .DeepEqual (appMgr .intF5Res , bufferF5Res ) {
1525- appMgr .intF5Res = bufferF5Res
1535+ if (len (appMgr .intF5Res [sKey .Namespace ]) != 0 || len (bufferF5Res ) != 0 ) &&
1536+ (! reflect .DeepEqual (appMgr .intF5Res [sKey .Namespace ], bufferF5Res )) {
1537+
1538+ appMgr .intF5Res [sKey .Namespace ] = bufferF5Res
15261539 stats .vsUpdated ++
15271540 }
15281541
0 commit comments