Server weight zero
This commit is contained in:
parent
edbcd01fbc
commit
8168d2fdc1
84 changed files with 378 additions and 273 deletions
6
vendor/github.com/containous/traefik-extra-service-fabric/servicefabric_config.go
generated
vendored
6
vendor/github.com/containous/traefik-extra-service-fabric/servicefabric_config.go
generated
vendored
|
@ -38,7 +38,7 @@ func (p *Provider) buildConfiguration(sfClient sfClient) (*types.Configuration,
|
|||
"filterServicesByLabelValue": filterServicesByLabelValue, // FIXME unused
|
||||
|
||||
// Backend functions
|
||||
"getWeight": getFuncServiceStringLabel(label.TraefikWeight, label.DefaultWeight),
|
||||
"getWeight": getFuncServiceIntLabel(label.TraefikWeight, label.DefaultWeightInt),
|
||||
"getProtocol": getFuncServiceStringLabel(label.TraefikProtocol, label.DefaultProtocol),
|
||||
"getMaxConn": getMaxConn,
|
||||
"getHealthCheck": getHealthCheck,
|
||||
|
@ -46,8 +46,8 @@ func (p *Provider) buildConfiguration(sfClient sfClient) (*types.Configuration,
|
|||
"getLoadBalancer": getLoadBalancer,
|
||||
|
||||
// Frontend Functions
|
||||
"getPriority": getFuncServiceStringLabel(label.TraefikFrontendPriority, label.DefaultFrontendPriority),
|
||||
"getPassHostHeader": getFuncServiceStringLabel(label.TraefikFrontendPassHostHeader, label.DefaultPassHostHeader),
|
||||
"getPriority": getFuncServiceIntLabel(label.TraefikFrontendPriority, label.DefaultFrontendPriorityInt),
|
||||
"getPassHostHeader": getFuncServiceBoolLabel(label.TraefikFrontendPassHostHeader, label.DefaultPassHostHeaderBool),
|
||||
"getPassTLSCert": getFuncBoolLabel(label.TraefikFrontendPassTLSCert, false),
|
||||
"getEntryPoints": getFuncServiceSliceStringLabel(label.TraefikFrontendEntryPoints),
|
||||
"getBasicAuth": getFuncServiceSliceStringLabel(label.TraefikFrontendAuthBasic),
|
||||
|
|
12
vendor/github.com/containous/traefik-extra-service-fabric/servicefabric_labelfuncs.go
generated
vendored
12
vendor/github.com/containous/traefik-extra-service-fabric/servicefabric_labelfuncs.go
generated
vendored
|
@ -30,6 +30,18 @@ func getFuncServiceStringLabel(labelName string, defaultValue string) func(servi
|
|||
}
|
||||
}
|
||||
|
||||
func getFuncServiceIntLabel(labelName string, defaultValue int) func(service ServiceItemExtended) int {
|
||||
return func(service ServiceItemExtended) int {
|
||||
return label.GetIntValue(service.Labels, labelName, defaultValue)
|
||||
}
|
||||
}
|
||||
|
||||
func getFuncServiceBoolLabel(labelName string, defaultValue bool) func(service ServiceItemExtended) bool {
|
||||
return func(service ServiceItemExtended) bool {
|
||||
return label.GetBoolValue(service.Labels, labelName, defaultValue)
|
||||
}
|
||||
}
|
||||
|
||||
func getFuncServiceSliceStringLabel(labelName string) func(service ServiceItemExtended) []string {
|
||||
return func(service ServiceItemExtended) []string {
|
||||
return label.GetSliceStringValue(service.Labels, labelName)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue