mirror of
https://github.com/juanfont/headscale.git
synced 2025-09-25 17:51:11 +02:00
Merge a9933f7266
into bd35fcf338
This commit is contained in:
commit
2ee9e8d44a
@ -338,10 +338,10 @@ func LoadConfig(path string, isFile bool) error {
|
|||||||
viper.SetDefault("prefixes.allocation", string(IPAllocationStrategySequential))
|
viper.SetDefault("prefixes.allocation", string(IPAllocationStrategySequential))
|
||||||
|
|
||||||
if err := viper.ReadInConfig(); err != nil {
|
if err := viper.ReadInConfig(); err != nil {
|
||||||
if errors.Is(err, fs.ErrNotExist) {
|
if _, ok := err.(viper.ConfigFileNotFoundError); ok {
|
||||||
log.Warn().Msg("No config file found, using defaults")
|
log.Warn().Msg("No config file found, using defaults")
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
return fmt.Errorf("fatal error reading config file: %w", err)
|
return fmt.Errorf("fatal error reading config file: %w", err)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user