Add proxy-pass-params annotation and Backend field

This commit is contained in:
Antoine Cotten 2017-08-31 15:09:23 +02:00
parent abc53ccfc5
commit c0fecd5bd7
No known key found for this signature in database
GPG key ID: EA06C9A94E2B3EA0
4 changed files with 26 additions and 1 deletions

View file

@ -32,6 +32,7 @@ const (
cookiePath = "ingress.kubernetes.io/proxy-cookie-path"
cookieDomain = "ingress.kubernetes.io/proxy-cookie-domain"
nextUpstream = "ingress.kubernetes.io/proxy-next-upstream"
passParams = "ingress.kubernetes.io/proxy-pass-params"
)
// Configuration returns the proxy timeout to use in the upstream server/s
@ -44,6 +45,7 @@ type Configuration struct {
CookieDomain string `json:"cookieDomain"`
CookiePath string `json:"cookiePath"`
NextUpstream string `json:"nextUpstream"`
PassParams string `json:"passParams"`
}
// Equal tests for equality between two Configuration types
@ -75,6 +77,12 @@ func (l1 *Configuration) Equal(l2 *Configuration) bool {
if l1.CookiePath != l2.CookiePath {
return false
}
if l1.NextUpstream != l2.NextUpstream {
return false
}
if l1.PassParams != l2.PassParams {
return false
}
return true
}
@ -132,5 +140,10 @@ func (a proxy) Parse(ing *extensions.Ingress) (interface{}, error) {
nu = defBackend.ProxyNextUpstream
}
return &Configuration{bs, ct, st, rt, bufs, cd, cp, nu}, nil
pp, err := parser.GetStringAnnotation(passParams, ing)
if err != nil || pp == "" {
pp = defBackend.ProxyPassParams
}
return &Configuration{bs, ct, st, rt, bufs, cd, cp, nu, pp}, nil
}