@@ -1576,9 +1576,6 @@ func (appMgr *Manager) createRSConfigFromIngress(
15761576 }
15771577 cfg .MetaData .ingName = ing .ObjectMeta .Name
15781578
1579- sslRedirect := getBooleanAnnotation (ing .ObjectMeta .Annotations ,
1580- ingressSslRedirect , true )
1581-
15821579 resources .Lock ()
15831580 defer resources .Unlock ()
15841581 // Check to see if we already have any Ingresses for this IP:Port
@@ -1625,7 +1622,7 @@ func (appMgr *Manager) createRSConfigFromIngress(
16251622 }
16261623 }
16271624 } else if len (cfg .Policies ) == 0 && plcy != nil {
1628- cfg .IngSetPolicy (* plcy , sslRedirect , pStruct . protocol )
1625+ cfg .SetPolicy (* plcy )
16291626 }
16301627 } else { // This is a new VS for an Ingress
16311628 cfg .MetaData .ResourceType = "ingress"
@@ -1635,7 +1632,7 @@ func (appMgr *Manager) createRSConfigFromIngress(
16351632 cfg .Virtual .SetVirtualAddress (bindAddr , pStruct .port )
16361633 cfg .Pools = append (cfg .Pools , pools ... )
16371634 if plcy != nil {
1638- cfg .IngSetPolicy (* plcy , sslRedirect , pStruct . protocol )
1635+ cfg .SetPolicy (* plcy )
16391636 }
16401637 }
16411638
@@ -2215,36 +2212,6 @@ func (rc *ResourceConfig) SetPolicy(policy Policy) {
22152212 rc .Policies = append (rc .Policies , policy )
22162213}
22172214
2218- func (rc * ResourceConfig ) IngSetPolicy (policy Policy , sslRedirect bool , pProtocol string ) {
2219- toFind := nameRef {
2220- Name : policy .Name ,
2221- Partition : policy .Partition ,
2222- }
2223- found := false
2224- for _ , polName := range rc .Virtual .Policies {
2225- if reflect .DeepEqual (toFind , polName ) {
2226- found = true
2227- break
2228- }
2229- }
2230- if ! found {
2231- if sslRedirect {
2232- if pProtocol == "https" {
2233- rc .Virtual .Policies = append (rc .Virtual .Policies , toFind )
2234- }
2235- } else {
2236- rc .Virtual .Policies = append (rc .Virtual .Policies , toFind )
2237- }
2238- }
2239- for i , pol := range rc .Policies {
2240- if pol .Name == policy .Name && pol .Partition == policy .Partition {
2241- rc .Policies [i ] = policy
2242- return
2243- }
2244- }
2245- rc .Policies = append (rc .Policies , policy )
2246- }
2247-
22482215func (rc * ResourceConfig ) RemovePolicy (policy Policy ) {
22492216 toFind := nameRef {
22502217 Name : policy .Name ,
0 commit comments