Add support for PathTypeExact

This commit is contained in:
Manuel Alejandro de Brito Fontes 2020-04-22 12:24:57 -04:00
parent 5559a59391
commit a95d850384
8 changed files with 221 additions and 51 deletions

View file

@ -39,6 +39,7 @@ import (
"github.com/pkg/errors"
networkingv1beta1 "k8s.io/api/networking/v1beta1"
"k8s.io/apimachinery/pkg/util/sets"
"k8s.io/klog"
@ -402,6 +403,11 @@ func buildLocation(input interface{}, enforceRegex bool) string {
if enforceRegex {
return fmt.Sprintf(`~* "^%s"`, path)
}
if location.PathType != nil && *location.PathType == networkingv1beta1.PathTypeExact {
return fmt.Sprintf(`= %s`, path)
}
return path
}