Merge branch 'v1.7.2' into master

This commit is contained in:
Fernandez Ludovic 2018-10-05 12:43:17 +02:00
commit 05f052b092
36 changed files with 696 additions and 176 deletions

View file

@ -1,6 +1,8 @@
package kubernetes
import (
"strconv"
"github.com/containous/traefik/provider/label"
)
@ -85,6 +87,13 @@ func getStringValue(annotations map[string]string, annotation string, defaultVal
return label.GetStringValue(annotations, annotationName, defaultValue)
}
func getStringSafeValue(annotations map[string]string, annotation string, defaultValue string) (string, error) {
annotationName := getAnnotationName(annotations, annotation)
value := label.GetStringValue(annotations, annotationName, defaultValue)
_, err := strconv.Unquote(`"` + value + `"`)
return value, err
}
func getBoolValue(annotations map[string]string, annotation string, defaultValue bool) bool {
annotationName := getAnnotationName(annotations, annotation)
return label.GetBoolValue(annotations, annotationName, defaultValue)