Skip to content

Commit 9cd0411

Browse files
committed
node: device-mgr: Add logs in the happy path
We have reasonable amount of logs when things go wrong. While debugging, it can be useful to have logs to indicate that things have gone as expected. Signed-off-by: Swati Sehgal <[email protected]>
1 parent a585bd7 commit 9cd0411

File tree

4 files changed

+8
-0
lines changed

4 files changed

+8
-0
lines changed

pkg/kubelet/cm/devicemanager/manager.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -506,6 +506,7 @@ func (m *ManagerImpl) writeCheckpoint() error {
506506
klog.ErrorS(err, "Failed to write checkpoint file")
507507
return err2
508508
}
509+
klog.V(4).InfoS("checkpoint file written", "checkpoint", kubeletDeviceManagerCheckpoint)
509510
return nil
510511
}
511512

@@ -534,6 +535,8 @@ func (m *ManagerImpl) readCheckpoint() error {
534535
m.unhealthyDevices[resource] = sets.New[string]()
535536
m.endpoints[resource] = endpointInfo{e: newStoppedEndpointImpl(resource), opts: nil}
536537
}
538+
539+
klog.V(4).InfoS("read data from checkpoint file", "checkpoint", kubeletDeviceManagerCheckpoint)
537540
return nil
538541
}
539542

pkg/kubelet/cm/devicemanager/plugin/v1beta1/client.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,8 @@ func (c *client) Disconnect() error {
106106
}
107107
c.mutex.Unlock()
108108
c.handler.PluginDisconnected(c.resource)
109+
110+
klog.V(2).InfoS("device plugin disconnected", "resource", c.resource)
109111
return nil
110112
}
111113

pkg/kubelet/cm/devicemanager/plugin/v1beta1/handler.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ func (s *server) ValidatePlugin(pluginName string, endpoint string, versions []s
6262
return fmt.Errorf("invalid name of device plugin socket: %s", fmt.Sprintf(errInvalidResourceName, pluginName))
6363
}
6464

65+
klog.V(2).InfoS("plugin validated", "plugin", pluginName, "endpoint", endpoint, "versions", versions)
6566
return nil
6667
}
6768

@@ -75,6 +76,7 @@ func (s *server) connectClient(name string, socketPath string) error {
7576
return err
7677
}
7778

79+
klog.V(2).InfoS("Connected to new client", "resource", name)
7880
go func() {
7981
s.runClient(name, c)
8082
}()

pkg/kubelet/cm/devicemanager/plugin/v1beta1/server.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@ func (s *server) Stop() error {
145145
// During kubelet termination, we do not need the registration server,
146146
// and we consider the kubelet to be healthy even when it is down.
147147
s.setHealthy()
148+
klog.V(2).InfoS("Stopping device plugin registration server")
148149

149150
return nil
150151
}

0 commit comments

Comments
 (0)