Skip to content

Commit 85ba7db

Browse files
vgramermjuraga
authored andcommitted
BUG/MINOR: configuration: fix missing logs during configuration loading
the logger is not initalized yet, so warnning messages were lost Signed-off-by: Vincent Gramer <[email protected]>
1 parent 7a496d3 commit 85ba7db

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

configuration/configuration.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ package configuration
1717

1818
import (
1919
"encoding/json"
20+
"errors"
2021
"fmt"
22+
"io/fs"
2123
"math/rand"
2224
"os"
2325
"path/filepath"
@@ -221,8 +223,8 @@ func (c *Configuration) Load() error {
221223
c.storage = &StorageHCL{}
222224
}
223225
if err = c.storage.Load(c.HAProxy.DataplaneConfig); err != nil {
224-
if os.IsNotExist(err) {
225-
log.Warningf("configuration file %s does not exists, creating one", c.HAProxy.DataplaneConfig)
226+
if errors.Is(err, fs.ErrNotExist) {
227+
fmt.Printf("configuration file %s does not exists, creating one\n", c.HAProxy.DataplaneConfig)
226228
} else {
227229
return fmt.Errorf("configuration file %s not valid: %w", c.HAProxy.DataplaneConfig, err)
228230
}

0 commit comments

Comments
 (0)