Frontend rule and segment labels.
This commit is contained in:
parent
118b4eb07a
commit
a731b43b52
11 changed files with 40 additions and 30 deletions
|
@ -1,6 +1,7 @@
|
|||
package rancher
|
||||
|
||||
import (
|
||||
"strings"
|
||||
"text/template"
|
||||
|
||||
"github.com/BurntSushi/ty/fun"
|
||||
|
@ -31,7 +32,7 @@ func (p *Provider) buildConfigurationV1(services []rancherData) *types.Configura
|
|||
|
||||
// Frontend functions
|
||||
"getBackend": getBackendNameV1,
|
||||
"getFrontendRule": p.getFrontendRule,
|
||||
"getFrontendRule": p.getFrontendRuleV1,
|
||||
"getPriority": getFuncIntV1(label.TraefikFrontendPriority, label.DefaultFrontendPriorityInt),
|
||||
"getPassHostHeader": getFuncBoolV1(label.TraefikFrontendPassHostHeader, label.DefaultPassHostHeaderBool),
|
||||
"getEntryPoints": getFuncSliceStringV1(label.TraefikFrontendEntryPoints),
|
||||
|
@ -109,9 +110,15 @@ func (p *Provider) serviceFilterV1(service rancherData) bool {
|
|||
return true
|
||||
}
|
||||
|
||||
// Deprecated
|
||||
func (p *Provider) getFrontendRuleV1(service rancherData) string {
|
||||
defaultRule := "Host:" + strings.ToLower(strings.Replace(service.Name, "/", ".", -1)) + "." + p.Domain
|
||||
return label.GetStringValue(service.Labels, label.TraefikFrontendRule, defaultRule)
|
||||
}
|
||||
|
||||
// Deprecated
|
||||
func (p *Provider) getFrontendNameV1(service rancherData) string {
|
||||
return provider.Normalize(p.getFrontendRule(service))
|
||||
return provider.Normalize(p.getFrontendRuleV1(service))
|
||||
}
|
||||
|
||||
// Deprecated
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue