Fix logging in Pinger
Fixes:
@@ -73,6 +73,8 @@ func newPinger(ip string, pingInterval time.Duration, maxPacketLossCount uint) P
}
func (p *pingerInfo) Start() {
+ klog.Infof("Starting pinger for IP %q", p.ip)
+
go func() {
for {
select {
@@ -99,8 +101,6 @@ func (p *pingerInfo) Stop() {
}
func (p *pingerInfo) doPing() error {
- klog.Infof("Starting pinger for IP %q", p.ip)
-
pinger, err := ping.NewPinger(p.ip)
if err != nil {
p.connectionStatus = ConnectionUnknown
@@ -154,8 +154,6 @@ func (p *pingerInfo) doPing() error {
return err
}
- klog.Infof("Pinger for IP %q stopped", p.ip)
-
return nil
}
