Co-authored-by: Kirill Trofimenkov <cgorbit@joom.com>
This commit is contained in:
parent
12a2a6d0e0
commit
0e606ddcb2
1 changed files with 2 additions and 8 deletions
|
@ -20,10 +20,8 @@ import (
|
|||
"fmt"
|
||||
"strings"
|
||||
|
||||
"github.com/mitchellh/copystructure"
|
||||
networking "k8s.io/api/networking/v1beta1"
|
||||
"k8s.io/ingress-nginx/internal/ingress"
|
||||
"k8s.io/klog/v2"
|
||||
)
|
||||
|
||||
var (
|
||||
|
@ -73,18 +71,14 @@ func updateServerLocations(locations []*ingress.Location) []*ingress.Location {
|
|||
continue
|
||||
}
|
||||
|
||||
// copy location before any change
|
||||
el, err := copystructure.Copy(location)
|
||||
if err != nil {
|
||||
klog.ErrorS(err, "copying location")
|
||||
}
|
||||
var el ingress.Location = *location
|
||||
|
||||
// normalize path. Must end in /
|
||||
location.Path = normalizePrefixPath(location.Path)
|
||||
newLocations = append(newLocations, location)
|
||||
|
||||
// add exact location
|
||||
exactLocation := el.(*ingress.Location)
|
||||
exactLocation := &el
|
||||
exactLocation.PathType = &pathTypeExact
|
||||
|
||||
newLocations = append(newLocations, exactLocation)
|
||||
|
|
Loading…
Reference in a new issue