File tree Expand file tree Collapse file tree 1 file changed +2
-5
lines changed Expand file tree Collapse file tree 1 file changed +2
-5
lines changed Original file line number Diff line number Diff line change @@ -20,12 +20,10 @@ import (
2020 "errors"
2121 "fmt"
2222 "io/fs"
23- "math/rand"
2423 "os"
2524 "path/filepath"
2625 "strings"
2726 "sync"
28- "time"
2927
3028 petname "github.com/dustinkirkland/golang-petname"
3129 "github.com/haproxytech/client-native/v4/models"
@@ -226,7 +224,7 @@ func (c *Configuration) Load() error {
226224 }
227225 if err = c .storage .Load (c .HAProxy .DataplaneConfig ); err != nil {
228226 if errors .Is (err , fs .ErrNotExist ) {
229- log . Warningf ("configuration file %s does not exists, creating one" , c .HAProxy .DataplaneConfig )
227+ fmt . Printf ("configuration file %s does not exists, creating one\n " , c .HAProxy .DataplaneConfig )
230228 } else {
231229 return fmt .Errorf ("configuration file %s not valid: %w" , c .HAProxy .DataplaneConfig , err )
232230 }
@@ -245,8 +243,7 @@ func (c *Configuration) Load() error {
245243 if c .Name .Load () == "" {
246244 hostname , nameErr := os .Hostname ()
247245 if nameErr != nil {
248- log .Warningf ("Error fetching hostname, using petname for dataplaneapi name: %s" , nameErr .Error ())
249- rand .Seed (time .Now ().UnixNano ())
246+ fmt .Printf ("Error fetching hostname, using petname for dataplaneapi name: %s\n " , nameErr .Error ())
250247 c .Name .Store (petname .Generate (2 , "_" ))
251248 }
252249 c .Name .Store (hostname )
You can’t perform that action at this time.
0 commit comments