Fix backend reuse
This commit is contained in:
parent
9cf4e730e7
commit
51227241b7
4 changed files with 94 additions and 8 deletions
|
@ -16,6 +16,7 @@ import (
|
|||
"github.com/containous/mux"
|
||||
"github.com/containous/traefik/log"
|
||||
traefiktls "github.com/containous/traefik/tls"
|
||||
"github.com/mitchellh/hashstructure"
|
||||
"github.com/ryanuber/go-glob"
|
||||
)
|
||||
|
||||
|
@ -177,9 +178,9 @@ func (h *Headers) HasSecureHeadersDefined() bool {
|
|||
|
||||
// Frontend holds frontend configuration.
|
||||
type Frontend struct {
|
||||
EntryPoints []string `json:"entryPoints,omitempty"`
|
||||
EntryPoints []string `json:"entryPoints,omitempty" hash:"ignore"`
|
||||
Backend string `json:"backend,omitempty"`
|
||||
Routes map[string]Route `json:"routes,omitempty"`
|
||||
Routes map[string]Route `json:"routes,omitempty" hash:"ignore"`
|
||||
PassHostHeader bool `json:"passHostHeader,omitempty"`
|
||||
PassTLSCert bool `json:"passTLSCert,omitempty"`
|
||||
Priority int `json:"priority"`
|
||||
|
@ -192,6 +193,17 @@ type Frontend struct {
|
|||
Redirect *Redirect `json:"redirect,omitempty"`
|
||||
}
|
||||
|
||||
// Hash returns the hash value of a Frontend struct.
|
||||
func (f *Frontend) Hash() (string, error) {
|
||||
hash, err := hashstructure.Hash(f, nil)
|
||||
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
return strconv.FormatUint(hash, 10), nil
|
||||
}
|
||||
|
||||
// Redirect configures a redirection of an entry point to another, or to an URL
|
||||
type Redirect struct {
|
||||
EntryPoint string `json:"entryPoint,omitempty"`
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue