@@ -30,7 +30,7 @@ import (
30
30
. "github.com/onsi/ginkgo"
31
31
. "github.com/onsi/gomega"
32
32
api "github.com/projectcalico/api/pkg/apis/projectcalico/v3"
33
- log "github.com/sirupsen/logrus"
33
+ "github.com/sirupsen/logrus"
34
34
35
35
"github.com/projectcalico/calico/felix/bpf/jump"
36
36
"github.com/projectcalico/calico/felix/bpf/polprog"
@@ -98,34 +98,34 @@ type workload interface {
98
98
99
99
func (f * Felix ) GetFelixPID () int {
100
100
if f .startupDelayed {
101
- log .Panic ("GetFelixPID() called but startup is delayed" )
101
+ logrus .Panic ("GetFelixPID() called but startup is delayed" )
102
102
}
103
103
if f .restartDelayed {
104
- log .Panic ("GetFelixPID() called but restart is delayed" )
104
+ logrus .Panic ("GetFelixPID() called but restart is delayed" )
105
105
}
106
106
return f .GetSinglePID ("calico-felix" )
107
107
}
108
108
109
109
func (f * Felix ) GetFelixPIDs () []int {
110
110
if f .startupDelayed {
111
- log .Panic ("GetFelixPIDs() called but startup is delayed" )
111
+ logrus .Panic ("GetFelixPIDs() called but startup is delayed" )
112
112
}
113
113
if f .restartDelayed {
114
- log .Panic ("GetFelixPIDs() called but restart is delayed" )
114
+ logrus .Panic ("GetFelixPIDs() called but restart is delayed" )
115
115
}
116
116
return f .GetPIDs ("calico-felix" )
117
117
}
118
118
119
119
func (f * Felix ) TriggerDelayedStart () {
120
120
if ! f .startupDelayed {
121
- log .Panic ("TriggerDelayedStart() called but startup wasn't delayed" )
121
+ logrus .Panic ("TriggerDelayedStart() called but startup wasn't delayed" )
122
122
}
123
123
f .Exec ("touch" , "/start-trigger" )
124
124
f .startupDelayed = false
125
125
}
126
126
127
127
func RunFelix (infra DatastoreInfra , id int , options TopologyOptions ) * Felix {
128
- log .Info ("Starting felix" )
128
+ logrus .Info ("Starting felix" )
129
129
ipv6Enabled := fmt .Sprint (options .EnableIPv6 )
130
130
bpfEnableIPv6 := fmt .Sprint (options .BPFEnableIPv6 )
131
131
@@ -181,10 +181,10 @@ func RunFelix(infra DatastoreInfra, id int, options TopologyOptions) *Felix {
181
181
182
182
if os .Getenv ("FELIX_FV_ENABLE_BPF" ) == "true" {
183
183
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" )
185
185
envVars ["FELIX_BPFENABLED" ] = "true"
186
186
} 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" )
188
188
}
189
189
190
190
if CreateCgroupV2 {
@@ -209,11 +209,14 @@ func RunFelix(infra DatastoreInfra, id int, options TopologyOptions) *Felix {
209
209
if options .FlowLogSource == FlowLogSourceGoldmane {
210
210
sockAddr := fmt .Sprintf ("%v/goldmane.sock" , logDir )
211
211
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
+ }
213
216
}
214
217
215
218
if os .Getenv ("FELIX_FV_NFTABLES" ) == "Enabled" {
216
- log .Info ("Enabling nftables with env var" )
219
+ logrus .Info ("Enabling nftables with env var" )
217
220
envVars ["FELIX_NFTABLESMODE" ] = "Enabled"
218
221
}
219
222
@@ -328,7 +331,7 @@ func (f *Felix) Restart() {
328
331
329
332
func (f * Felix ) RestartWithDelayedStartup () func () {
330
333
if f .restartDelayed {
331
- log .Panic ("RestartWithDelayedStartup() called but restart was delayed already" )
334
+ logrus .Panic ("RestartWithDelayedStartup() called but restart was delayed already" )
332
335
}
333
336
oldPID := f .GetFelixPID ()
334
337
f .restartDelayed = true
@@ -341,7 +344,7 @@ func (f *Felix) RestartWithDelayedStartup() func() {
341
344
defer GinkgoRecover ()
342
345
select {
343
346
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" )
345
348
case <- triggerChan :
346
349
return
347
350
}
0 commit comments