Update some docker provider test
- Split the file into smaller ones (docker, swarm and service tests) - Use some builder to reduce a little bit the noise for creating containers Signed-off-by: Vincent Demeester <vincent@sbr.pm>
This commit is contained in:
parent
3f293ee25b
commit
b04ba36682
7 changed files with 1797 additions and 2565 deletions
|
@ -51,6 +51,7 @@ func (p *BaseProvider) MatchConstraints(tags []string) (bool, *types.Constraint)
|
|||
return true, nil
|
||||
}
|
||||
|
||||
// GetConfiguration return the provider configuration using templating
|
||||
func (p *BaseProvider) GetConfiguration(defaultTemplateFile string, funcMap template.FuncMap, templateObjects interface{}) (*types.Configuration, error) {
|
||||
var (
|
||||
buf []byte
|
||||
|
@ -60,7 +61,7 @@ func (p *BaseProvider) GetConfiguration(defaultTemplateFile string, funcMap temp
|
|||
var defaultFuncMap = template.FuncMap{
|
||||
"replace": replace,
|
||||
"tolower": strings.ToLower,
|
||||
"Normalize": Normalize,
|
||||
"normalize": Normalize,
|
||||
"split": split,
|
||||
"contains": contains,
|
||||
}
|
||||
|
@ -112,6 +113,7 @@ func split(sep, s string) []string {
|
|||
return strings.Split(s, sep)
|
||||
}
|
||||
|
||||
// Normalize transform a string that work with the rest of traefik
|
||||
func Normalize(name string) string {
|
||||
fargs := func(c rune) bool {
|
||||
return !unicode.IsLetter(c) && !unicode.IsNumber(c)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue