Skip to content

Commit 1edd614

Browse files
committed
fix location path
1 parent cb985d4 commit 1edd614

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

internal/ingress/controller/store/utils.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import (
1010
type ServiceInfo struct {
1111
Hosts []string
1212
NodeIps []string
13+
Paths []string
1314
NodePort int
1415
Annotations map[string]string
1516
}
@@ -37,13 +38,15 @@ func getIngressServiceInfo(ingress *networkv1.Ingress, store Storer) (map[string
3738
if _, ok := servicesInfo[serviceName]; !ok {
3839
servicesInfo[serviceName] = ServiceInfo{
3940
Hosts: []string{rule.Host},
41+
Paths: []string{path.Path},
4042
NodePort: int(port.NodePort),
4143
NodeIps: nodeIps,
4244
Annotations: service.Annotations,
4345
}
4446
} else {
4547
sTmp := servicesInfo[serviceName]
4648
sTmp.Hosts = append(sTmp.Hosts, rule.Host)
49+
sTmp.Paths = append(sTmp.Paths, path.Path)
4750
servicesInfo[serviceName] = sTmp
4851
}
4952
} else {

internal/service/loadbalancer/manager.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -174,10 +174,12 @@ func (m *Manager) TranslateIngressToLB(ingress *networkv1.Ingress, sslCerts map[
174174
sslEnabled = true
175175
vhostPorts = []int32{443}
176176
}
177-
locationZones = append(locationZones, serverscom.L7LocationZoneInput{
178-
Location: "/",
179-
UpstreamID: upstreamId,
180-
})
177+
for _, p := range service.Paths {
178+
locationZones = append(locationZones, serverscom.L7LocationZoneInput{
179+
Location: p,
180+
UpstreamID: upstreamId,
181+
})
182+
}
181183
}
182184

183185
vZInput := serverscom.L7VHostZoneInput{

0 commit comments

Comments
 (0)