Compatible with nginx.ingress.kubernetes.io/canary-by-header-pattern annotation (#693)

This commit is contained in:
Se7en
2023-12-19 15:42:26 +08:00
committed by GitHub
parent e760b4d0ab
commit 2548815667
3 changed files with 136 additions and 4 deletions

View File

@@ -154,7 +154,7 @@ func ApplyByHeader(canary, route *networking.HTTPRoute, canaryIngress *Ingress)
match.Headers = map[string]*networking.StringMatch{
canaryConfig.Header: {
MatchType: &networking.StringMatch_Regex{
Regex: canaryConfig.HeaderPattern,
Regex: ".*" + canaryConfig.HeaderPattern + ".*",
},
},
}