Skip to content

Commit 7fa131c

Browse files
authored
Merge pull request #830 from F5Networks/revert-816-vli-PR
Revert "http_redirect_irule_443 irule should honor custom http port"
2 parents 9294575 + fb4fb4e commit 7fa131c

File tree

2 files changed

+3
-36
lines changed

2 files changed

+3
-36
lines changed

pkg/appmanager/resourceConfig.go

Lines changed: 2 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -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-
22482215
func (rc *ResourceConfig) RemovePolicy(policy Policy) {
22492216
toFind := nameRef{
22502217
Name: policy.Name,

pkg/appmanager/routing.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ func httpRedirectIRule(port int32) string {
350350
iRuleCode := fmt.Sprintf(`
351351
when HTTP_REQUEST {
352352
# Look for exact match for host name
353-
set paths [class match -value [getfield [HTTP::host] ":" 1] equals https_redirect_dg]
353+
set paths [class match -value [HTTP::host] equals https_redirect_dg]
354354
if {$paths == ""} {
355355
# See if there's an entry that matches all hosts
356356
set paths [class match -value "*" equals https_redirect_dg]

0 commit comments

Comments
 (0)