Sync vendor and glide.
This commit is contained in:
parent
9fe6a0a894
commit
7081f3df58
12 changed files with 374 additions and 190 deletions
23
vendor/github.com/containous/traefik-extra-service-fabric/labels.go
generated
vendored
Normal file
23
vendor/github.com/containous/traefik-extra-service-fabric/labels.go
generated
vendored
Normal file
|
@ -0,0 +1,23 @@
|
|||
package servicefabric
|
||||
|
||||
import "strings"
|
||||
|
||||
func hasServiceLabel(service ServiceItemExtended, key string) bool {
|
||||
_, exists := service.Labels[key]
|
||||
return exists
|
||||
}
|
||||
|
||||
func getFuncBoolLabel(labelName string) func(service ServiceItemExtended) bool {
|
||||
return func(service ServiceItemExtended) bool {
|
||||
return getBoolLabel(service, labelName)
|
||||
}
|
||||
}
|
||||
|
||||
func getBoolLabel(service ServiceItemExtended, labelName string) bool {
|
||||
value, exists := service.Labels[labelName]
|
||||
return exists && strings.EqualFold(strings.TrimSpace(value), "true")
|
||||
}
|
||||
|
||||
func getServiceLabelValue(service ServiceItemExtended, key string) string {
|
||||
return service.Labels[key]
|
||||
}
|
10
vendor/github.com/containous/traefik-extra-service-fabric/servicefabric.go
generated
vendored
10
vendor/github.com/containous/traefik-extra-service-fabric/servicefabric.go
generated
vendored
|
@ -92,6 +92,7 @@ func (p *Provider) updateConfig(configurationChan chan<- types.ConfigMessage, po
|
|||
"getServiceLabelsWithPrefix": getServiceLabelsWithPrefix,
|
||||
"getServicesWithLabelValueMap": getServicesWithLabelValueMap,
|
||||
"getServicesWithLabelValue": getServicesWithLabelValue,
|
||||
"isExposed": getFuncBoolLabel("expose"),
|
||||
}
|
||||
|
||||
configuration, err := p.GetConfiguration(tmpl, sfFuncMap, templateObjects)
|
||||
|
@ -235,15 +236,6 @@ func getValidInstances(sfClient sfClient, app sf.ApplicationItem, service sf.Ser
|
|||
return validInstances
|
||||
}
|
||||
|
||||
func hasServiceLabel(service ServiceItemExtended, key string) bool {
|
||||
_, exists := service.Labels[key]
|
||||
return exists
|
||||
}
|
||||
|
||||
func getServiceLabelValue(service ServiceItemExtended, key string) string {
|
||||
return service.Labels[key]
|
||||
}
|
||||
|
||||
func getServicesWithLabelValueMap(services []ServiceItemExtended, key string) map[string][]ServiceItemExtended {
|
||||
result := map[string][]ServiceItemExtended{}
|
||||
for _, service := range services {
|
||||
|
|
3
vendor/github.com/containous/traefik-extra-service-fabric/servicefabric_tmpl.go
generated
vendored
3
vendor/github.com/containous/traefik-extra-service-fabric/servicefabric_tmpl.go
generated
vendored
|
@ -91,13 +91,12 @@ const tmpl = `
|
|||
{{end}}
|
||||
{{end}}
|
||||
{{range $service := .Services}}
|
||||
{{if hasServiceLabel $service "expose"}}
|
||||
{{if isExposed $service}}
|
||||
{{if eq $service.ServiceKind "Stateless"}}
|
||||
|
||||
[frontends."{{$service.Name}}"]
|
||||
backend = "{{$service.Name}}"
|
||||
|
||||
|
||||
{{if hasServiceLabel $service "frontend.passHostHeader"}}
|
||||
passHostHeader = {{getServiceLabelValue $service "frontend.passHostHeader" }}
|
||||
{{end}}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue