Formatting and improving logs for config loading

This commit is contained in:
Kristoffer Dalby 2022-01-25 22:11:15 +00:00
parent 6e14fdf0d3
commit 05db1b7109
2 changed files with 6 additions and 2 deletions

View file

@ -44,7 +44,7 @@ func main() {
}) })
if err := cli.LoadConfig(""); err != nil { if err := cli.LoadConfig(""); err != nil {
log.Fatal().Err(err) log.Fatal().Caller().Err(err)
} }
machineOutput := cli.HasMachineOutputFlag() machineOutput := cli.HasMachineOutputFlag()

View file

@ -61,7 +61,11 @@ func (*Suite) TestConfigLoading(c *check.C) {
c.Assert(viper.GetString("tls_letsencrypt_listen"), check.Equals, ":http") c.Assert(viper.GetString("tls_letsencrypt_listen"), check.Equals, ":http")
c.Assert(viper.GetString("tls_letsencrypt_challenge_type"), check.Equals, "HTTP-01") c.Assert(viper.GetString("tls_letsencrypt_challenge_type"), check.Equals, "HTTP-01")
c.Assert(viper.GetStringSlice("dns_config.nameservers")[0], check.Equals, "1.1.1.1") c.Assert(viper.GetStringSlice("dns_config.nameservers")[0], check.Equals, "1.1.1.1")
c.Assert(cli.GetFileMode("unix_socket_permission"), check.Equals, fs.FileMode(0o770)) c.Assert(
cli.GetFileMode("unix_socket_permission"),
check.Equals,
fs.FileMode(0o770),
)
} }
func (*Suite) TestDNSConfigLoading(c *check.C) { func (*Suite) TestDNSConfigLoading(c *check.C) {