Skip to content

Commit 71e3bd2

Browse files
committed
Fix linter
1 parent 71437b5 commit 71e3bd2

File tree

1 file changed

+16
-13
lines changed

1 file changed

+16
-13
lines changed

felix/fv/infrastructure/felix.go

+16-13
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ import (
3030
. "github.com/onsi/ginkgo"
3131
. "github.com/onsi/gomega"
3232
api "github.com/projectcalico/api/pkg/apis/projectcalico/v3"
33-
log "github.com/sirupsen/logrus"
33+
"github.com/sirupsen/logrus"
3434

3535
"github.com/projectcalico/calico/felix/bpf/jump"
3636
"github.com/projectcalico/calico/felix/bpf/polprog"
@@ -98,34 +98,34 @@ type workload interface {
9898

9999
func (f *Felix) GetFelixPID() int {
100100
if f.startupDelayed {
101-
log.Panic("GetFelixPID() called but startup is delayed")
101+
logrus.Panic("GetFelixPID() called but startup is delayed")
102102
}
103103
if f.restartDelayed {
104-
log.Panic("GetFelixPID() called but restart is delayed")
104+
logrus.Panic("GetFelixPID() called but restart is delayed")
105105
}
106106
return f.GetSinglePID("calico-felix")
107107
}
108108

109109
func (f *Felix) GetFelixPIDs() []int {
110110
if f.startupDelayed {
111-
log.Panic("GetFelixPIDs() called but startup is delayed")
111+
logrus.Panic("GetFelixPIDs() called but startup is delayed")
112112
}
113113
if f.restartDelayed {
114-
log.Panic("GetFelixPIDs() called but restart is delayed")
114+
logrus.Panic("GetFelixPIDs() called but restart is delayed")
115115
}
116116
return f.GetPIDs("calico-felix")
117117
}
118118

119119
func (f *Felix) TriggerDelayedStart() {
120120
if !f.startupDelayed {
121-
log.Panic("TriggerDelayedStart() called but startup wasn't delayed")
121+
logrus.Panic("TriggerDelayedStart() called but startup wasn't delayed")
122122
}
123123
f.Exec("touch", "/start-trigger")
124124
f.startupDelayed = false
125125
}
126126

127127
func RunFelix(infra DatastoreInfra, id int, options TopologyOptions) *Felix {
128-
log.Info("Starting felix")
128+
logrus.Info("Starting felix")
129129
ipv6Enabled := fmt.Sprint(options.EnableIPv6)
130130
bpfEnableIPv6 := fmt.Sprint(options.BPFEnableIPv6)
131131

@@ -181,10 +181,10 @@ func RunFelix(infra DatastoreInfra, id int, options TopologyOptions) *Felix {
181181

182182
if os.Getenv("FELIX_FV_ENABLE_BPF") == "true" {
183183
if !options.TestManagesBPF {
184-
log.Info("FELIX_FV_ENABLE_BPF=true, enabling BPF with env var")
184+
logrus.Info("FELIX_FV_ENABLE_BPF=true, enabling BPF with env var")
185185
envVars["FELIX_BPFENABLED"] = "true"
186186
} else {
187-
log.Info("FELIX_FV_ENABLE_BPF=true but test manages BPF state itself, not using env var")
187+
logrus.Info("FELIX_FV_ENABLE_BPF=true but test manages BPF state itself, not using env var")
188188
}
189189

190190
if CreateCgroupV2 {
@@ -209,11 +209,14 @@ func RunFelix(infra DatastoreInfra, id int, options TopologyOptions) *Felix {
209209
if options.FlowLogSource == FlowLogSourceGoldmane {
210210
sockAddr := fmt.Sprintf("%v/goldmane.sock", logDir)
211211
goldmaneServer = goldmane.NewNodeServer(sockAddr)
212-
goldmaneServer.Run()
212+
err := goldmaneServer.Run()
213+
if err != nil {
214+
logrus.WithError(err).Panic("Failed to start goldmane node server")
215+
}
213216
}
214217

215218
if os.Getenv("FELIX_FV_NFTABLES") == "Enabled" {
216-
log.Info("Enabling nftables with env var")
219+
logrus.Info("Enabling nftables with env var")
217220
envVars["FELIX_NFTABLESMODE"] = "Enabled"
218221
}
219222

@@ -328,7 +331,7 @@ func (f *Felix) Restart() {
328331

329332
func (f *Felix) RestartWithDelayedStartup() func() {
330333
if f.restartDelayed {
331-
log.Panic("RestartWithDelayedStartup() called but restart was delayed already")
334+
logrus.Panic("RestartWithDelayedStartup() called but restart was delayed already")
332335
}
333336
oldPID := f.GetFelixPID()
334337
f.restartDelayed = true
@@ -341,7 +344,7 @@ func (f *Felix) RestartWithDelayedStartup() func() {
341344
defer GinkgoRecover()
342345
select {
343346
case <-time.After(time.Second * 30):
344-
log.Panic("Restart with delayed startup timed out after 30s")
347+
logrus.Panic("Restart with delayed startup timed out after 30s")
345348
case <-triggerChan:
346349
return
347350
}

0 commit comments

Comments
 (0)