mirror of
https://github.com/containous/traefik.git
synced 2024-12-24 21:34:39 +03:00
Fixes following review
This commit is contained in:
parent
8adadaa5d4
commit
f1b62b45f4
@ -1,16 +1,16 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"errors"
|
||||||
|
"fmt"
|
||||||
fmtlog "log"
|
fmtlog "log"
|
||||||
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"fmt"
|
|
||||||
"github.com/emilevauge/traefik/provider"
|
"github.com/emilevauge/traefik/provider"
|
||||||
"github.com/emilevauge/traefik/types"
|
"github.com/emilevauge/traefik/types"
|
||||||
"github.com/mitchellh/mapstructure"
|
"github.com/mitchellh/mapstructure"
|
||||||
"github.com/spf13/viper"
|
"github.com/spf13/viper"
|
||||||
"github.com/wendal/errors"
|
|
||||||
"strings"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// GlobalConfiguration holds global configuration (with providers, etc.).
|
// GlobalConfiguration holds global configuration (with providers, etc.).
|
||||||
@ -97,8 +97,7 @@ func LoadConfiguration() *GlobalConfiguration {
|
|||||||
viper.AddConfigPath("/etc/traefik/") // path to look for the config file in
|
viper.AddConfigPath("/etc/traefik/") // path to look for the config file in
|
||||||
viper.AddConfigPath("$HOME/.traefik/") // call multiple times to add many search paths
|
viper.AddConfigPath("$HOME/.traefik/") // call multiple times to add many search paths
|
||||||
viper.AddConfigPath(".") // optionally look for config in the working directory
|
viper.AddConfigPath(".") // optionally look for config in the working directory
|
||||||
err := viper.ReadInConfig() // Find and read the config file
|
if err := viper.ReadInConfig(); err != nil {
|
||||||
if err != nil { // Handle errors reading the config file
|
|
||||||
fmtlog.Fatalf("Error reading file: %s", err)
|
fmtlog.Fatalf("Error reading file: %s", err)
|
||||||
}
|
}
|
||||||
if len(arguments.Certificates) > 0 {
|
if len(arguments.Certificates) > 0 {
|
||||||
@ -131,8 +130,7 @@ func LoadConfiguration() *GlobalConfiguration {
|
|||||||
if arguments.boltdb {
|
if arguments.boltdb {
|
||||||
viper.Set("boltdb", arguments.Boltdb)
|
viper.Set("boltdb", arguments.Boltdb)
|
||||||
}
|
}
|
||||||
err = unmarshal(&configuration)
|
if err := unmarshal(&configuration); err != nil {
|
||||||
if err != nil {
|
|
||||||
fmtlog.Fatalf("Error reading file: %s", err)
|
fmtlog.Fatalf("Error reading file: %s", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -148,10 +148,17 @@ import:
|
|||||||
ref: fca8c8854093a154ff1eb580aae10276ad6b1b5f
|
ref: fca8c8854093a154ff1eb580aae10276ad6b1b5f
|
||||||
- package: github.com/spf13/cast
|
- package: github.com/spf13/cast
|
||||||
ref: ee7b3e0353166ab1f3a605294ac8cd2b77953778
|
ref: ee7b3e0353166ab1f3a605294ac8cd2b77953778
|
||||||
|
- package: github.com/mitchellh/mapstructure
|
||||||
|
- package: github.com/spf13/jwalterweatherman
|
||||||
|
- package: github.com/spf13/pflag
|
||||||
|
- package: github.com/wendal/errors
|
||||||
|
- package: github.com/hashicorp/hcl
|
||||||
|
- package: github.com/kr/pretty
|
||||||
|
- package: github.com/magiconair/properties
|
||||||
|
- package: github.com/kr/text
|
||||||
- package: github.com/spf13/viper
|
- package: github.com/spf13/viper
|
||||||
ref: a212099cbe6fbe8d07476bfda8d2d39b6ff8f325
|
ref: a212099cbe6fbe8d07476bfda8d2d39b6ff8f325
|
||||||
- package: github.com/spf13/cobra
|
- package: github.com/spf13/cobra
|
||||||
subpackages:
|
subpackages:
|
||||||
- /cobra
|
- /cobra
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user