K8s: add an option to configure "PathPrefixStrip" for the ingress-resource using annotation
This commit is contained in:
parent
993165fa66
commit
9773d4e409
1 changed files with 8 additions and 2 deletions
|
@ -165,8 +165,14 @@ func (provider *Kubernetes) loadIngresses(k8sClient k8s.Client) (*types.Configur
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if len(pa.Path) > 0 {
|
if len(pa.Path) > 0 {
|
||||||
templateObjects.Frontends[r.Host+pa.Path].Routes[pa.Path] = types.Route{
|
if _, ok := i.Annotations["PathPrefixStrip"]; ok {
|
||||||
Rule: "PathPrefix:" + pa.Path,
|
templateObjects.Frontends[r.Host+pa.Path].Routes[pa.Path] = types.Route{
|
||||||
|
Rule: "PathPrefixStrip:" + pa.Path,
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
templateObjects.Frontends[r.Host+pa.Path].Routes[pa.Path] = types.Route{
|
||||||
|
Rule: "PathPrefix:" + pa.Path,
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
services, err := k8sClient.GetServices(func(service k8s.Service) bool {
|
services, err := k8sClient.GetServices(func(service k8s.Service) bool {
|
||||||
|
|
Loading…
Reference in a new issue