Skip to content

Commit 3c14934

Browse files
committed
refactor: replace Debugf with Debug for logging messages
Signed-off-by: fahed dorgaa <[email protected]>
1 parent 185f2b1 commit 3c14934

File tree

5 files changed

+12
-12
lines changed

5 files changed

+12
-12
lines changed

pkg/network/gvisortapvsock/gvisortapvsock.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ func (d *parentDriver) acceptConnections() {
243243
if err != nil {
244244
// Check if the error is due to the listener being closed, which is expected during cleanup
245245
if errors.Is(err, io.EOF) || strings.Contains(err.Error(), "use of closed network connection") {
246-
logrus.Debugf("listener closed, stopping accept loop")
246+
logrus.Debug("listener closed, stopping accept loop")
247247
return
248248
}
249249
logrus.Errorf("accepting connection: %v", err)
@@ -271,9 +271,9 @@ func (d *parentDriver) handleConnection(conn net.Conn) {
271271

272272
// Use the AcceptStdio function to stream packets between the Unix socket and the virtual network
273273
// This will handle the connection and forward packets in both directions
274-
logrus.Debugf("forwarding packets between Unix socket and virtual network using VfkitProtocol")
274+
logrus.Debug("forwarding packets between Unix socket and virtual network using VfkitProtocol")
275275
if err := vn.AcceptStdio(d.ctx, conn); err != nil {
276-
logrus.Debugf(err.Error())
276+
logrus.Debug(err)
277277
if errors.Is(err, io.EOF) {
278278
// This is expected when the child process exits
279279
logrus.Debugf("child process exited, connection closed: %v", err)
@@ -286,7 +286,7 @@ func (d *parentDriver) handleConnection(conn net.Conn) {
286286
// createCleanupFunc creates a cleanup function for the virtual network
287287
func (d *parentDriver) createCleanupFunc(vn *virtualnetwork.VirtualNetwork) func() error {
288288
return func() error {
289-
logrus.Debugf("closing gvisor-tap-vsock virtual network")
289+
logrus.Debug("closing gvisor-tap-vsock virtual network")
290290
// The VirtualNetwork struct doesn't have an explicit Close method,
291291
// but we'll keep a reference to it to prevent garbage collection
292292
_ = vn
@@ -301,7 +301,7 @@ func (d *parentDriver) createCleanupFunc(vn *virtualnetwork.VirtualNetwork) func
301301
}
302302
}
303303

304-
logrus.Debugf("closed gvisor-tap-vsock virtual network")
304+
logrus.Debug("closed gvisor-tap-vsock virtual network")
305305
return nil
306306
}
307307
}

pkg/network/slirp4netns/slirp4netns.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ func (d *parentDriver) ConfigureNetwork(childPID int, stateDir, detachedNetNSPat
226226
}
227227
cmd.ExtraFiles = append(cmd.ExtraFiles, readyW)
228228
cleanups = append(cleanups, func() error {
229-
logrus.Debugf("killing slirp4netns")
229+
logrus.Debug("killing slirp4netns")
230230
if cmd.Process != nil {
231231
_ = cmd.Process.Kill()
232232
}

pkg/network/vpnkit/vpnkit.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ func (d *parentDriver) ConfigureNetwork(childPID int, stateDir, detachedNetNSPat
9797
Pdeathsig: syscall.SIGKILL,
9898
}
9999
cleanups = append(cleanups, func() error {
100-
logrus.Debugf("killing vpnkit")
100+
logrus.Debug("killing vpnkit")
101101
vpnkitCancel()
102102
wErr := vpnkitCmd.Wait()
103103
logrus.Debugf("killed vpnkit: %v", wErr)
@@ -120,7 +120,7 @@ func (d *parentDriver) ConfigureNetwork(childPID int, stateDir, detachedNetNSPat
120120
if err != nil {
121121
return nil, common.Seq(cleanups), fmt.Errorf("connecting to %s with uuid %s: %w", vpnkitSocket, vifUUID, err)
122122
}
123-
logrus.Debugf("connected to VPNKit vmnet")
123+
logrus.Debug("connected to VPNKit vmnet")
124124
// TODO: support configuration
125125
netmsg := messages.ParentInitNetworkDriverCompleted{
126126
Dev: d.ifname,

pkg/parent/parent.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -367,10 +367,10 @@ func getSubIDRanges(u *user.User, subidSource SubidSource) ([]idtools.SubIDRange
367367
}
368368
switch subidSource {
369369
case SubidSourceStatic:
370-
logrus.Debugf("subid-source: using the static source")
370+
logrus.Debug("subid-source: using the static source")
371371
return idtools.GetSubIDRanges(uid, u.Username)
372372
case SubidSourceDynamic:
373-
logrus.Debugf("subid-source: using the dynamic source")
373+
logrus.Debug("subid-source: using the dynamic source")
374374
return dynidtools.GetSubIDRanges(uid, u.Username)
375375
case "", SubidSourceAuto:
376376
subuidRanges, subgidRanges, err := getSubIDRanges(u, SubidSourceDynamic)

pkg/port/gvisortapvsock/gvisortapvsock.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,15 +193,15 @@ func (d *driver) RunParentDriver(initComplete chan struct{}, quit <-chan struct{
193193
// Get the virtual network from the child context
194194
if cctx != nil && cctx.Network != nil {
195195
d.servicesMux = cctx.Network.Mux()
196-
logrus.Debugf("Using services mux from child context")
196+
logrus.Debug("Using services mux from child context")
197197
}
198198

199199
if d.servicesMux == nil {
200200
return fmt.Errorf("Virtual network services mux not available in child context")
201201
}
202202

203203
d.mu.Unlock()
204-
logrus.Debugf("Created virtual network")
204+
logrus.Debug("Created virtual network")
205205

206206
// Signal that initialization is complete
207207
close(initComplete)

0 commit comments

Comments
 (0)