Filter env vars configuration
This commit is contained in:
parent
adc9a65ae3
commit
a918dcd5a4
19 changed files with 284 additions and 79 deletions
|
@ -17,7 +17,7 @@ func Decode(args []string, element interface{}) error {
|
|||
return err
|
||||
}
|
||||
|
||||
return parser.Decode(ref, element)
|
||||
return parser.Decode(ref, element, parser.DefaultRootName)
|
||||
}
|
||||
|
||||
// Encode encodes the configuration in element into the flags represented in the returned Flats.
|
||||
|
@ -30,7 +30,7 @@ func Encode(element interface{}) ([]parser.Flat, error) {
|
|||
return nil, nil
|
||||
}
|
||||
|
||||
node, err := parser.EncodeToNode(element, false)
|
||||
node, err := parser.EncodeToNode(element, parser.DefaultRootName, false)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
|
@ -4,6 +4,8 @@ import (
|
|||
"fmt"
|
||||
"reflect"
|
||||
"strings"
|
||||
|
||||
"github.com/containous/traefik/pkg/config/parser"
|
||||
)
|
||||
|
||||
// Parse parses the command-line flag arguments into a map,
|
||||
|
@ -96,7 +98,7 @@ func (f *flagSet) parseOne() (bool, error) {
|
|||
}
|
||||
|
||||
func (f *flagSet) setValue(name string, value string) {
|
||||
n := strings.ToLower("traefik." + name)
|
||||
n := strings.ToLower(parser.DefaultRootName + "." + name)
|
||||
v, ok := f.values[n]
|
||||
|
||||
if ok && f.flagTypes[name] == reflect.Slice {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue