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 (
20
20
"errors"
21
21
"fmt"
22
22
"io/fs"
23
- "math/rand"
24
23
"os"
25
24
"path/filepath"
26
25
"strings"
27
26
"sync"
28
- "time"
29
27
30
28
petname "github.com/dustinkirkland/golang-petname"
31
29
"github.com/haproxytech/client-native/v4/models"
@@ -226,7 +224,7 @@ func (c *Configuration) Load() error {
226
224
}
227
225
if err = c .storage .Load (c .HAProxy .DataplaneConfig ); err != nil {
228
226
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 )
230
228
} else {
231
229
return fmt .Errorf ("configuration file %s not valid: %w" , c .HAProxy .DataplaneConfig , err )
232
230
}
@@ -245,8 +243,7 @@ func (c *Configuration) Load() error {
245
243
if c .Name .Load () == "" {
246
244
hostname , nameErr := os .Hostname ()
247
245
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 ())
250
247
c .Name .Store (petname .Generate (2 , "_" ))
251
248
}
252
249
c .Name .Store (hostname )
You can’t perform that action at this time.
0 commit comments