node: device-mgr: Update klog.Infof(..., err) to klog.ErrorS(err,...)

Signed-off-by: Swati Sehgal <swsehgal@redhat.com>
This commit is contained in:
Swati Sehgal 2025-01-22 16:03:54 +00:00
parent 9cd041156f
commit 19e406a357
2 changed files with 6 additions and 6 deletions

View File

@ -114,7 +114,7 @@ func (s *server) runClient(name string, c Client) {
} }
if err := s.disconnectClient(name, c); err != nil { if err := s.disconnectClient(name, c); err != nil {
klog.V(2).InfoS("Unable to disconnect client", "resource", name, "client", c, "err", err) klog.ErrorS(err, "Unable to disconnect client", "resource", name, "client", c)
} }
} }

View File

@ -91,7 +91,7 @@ func (s *server) Start() error {
if selinux.GetEnabled() { if selinux.GetEnabled() {
if err := selinux.SetFileLabel(s.socketDir, config.KubeletPluginsDirSELinuxLabel); err != nil { if err := selinux.SetFileLabel(s.socketDir, config.KubeletPluginsDirSELinuxLabel); err != nil {
klog.InfoS("Unprivileged containerized plugins might not work. Could not set selinux context on socket dir", "path", s.socketDir, "err", err) klog.ErrorS(err, "Unprivileged containerized plugins might not work. Could not set selinux context on socket dir", "path", s.socketDir)
} }
} }
@ -128,7 +128,7 @@ func (s *server) Start() error {
func (s *server) Stop() error { func (s *server) Stop() error {
s.visitClients(func(r string, c Client) { s.visitClients(func(r string, c Client) {
if err := s.disconnectClient(r, c); err != nil { if err := s.disconnectClient(r, c); err != nil {
klog.InfoS("Error disconnecting device plugin client", "resourceName", r, "err", err) klog.ErrorS(err, "Error disconnecting device plugin client", "resourceName", r)
} }
}) })
@ -160,18 +160,18 @@ func (s *server) Register(ctx context.Context, r *api.RegisterRequest) (*api.Emp
if !s.isVersionCompatibleWithPlugin(r.Version) { if !s.isVersionCompatibleWithPlugin(r.Version) {
err := fmt.Errorf(errUnsupportedVersion, r.Version, api.SupportedVersions) err := fmt.Errorf(errUnsupportedVersion, r.Version, api.SupportedVersions)
klog.InfoS("Bad registration request from device plugin with resource", "resourceName", r.ResourceName, "err", err) klog.ErrorS(err, "Bad registration request from device plugin with resource", "resourceName", r.ResourceName)
return &api.Empty{}, err return &api.Empty{}, err
} }
if !v1helper.IsExtendedResourceName(core.ResourceName(r.ResourceName)) { if !v1helper.IsExtendedResourceName(core.ResourceName(r.ResourceName)) {
err := fmt.Errorf(errInvalidResourceName, r.ResourceName) err := fmt.Errorf(errInvalidResourceName, r.ResourceName)
klog.InfoS("Bad registration request from device plugin", "err", err) klog.ErrorS(err, "Bad registration request from device plugin")
return &api.Empty{}, err return &api.Empty{}, err
} }
if err := s.connectClient(r.ResourceName, filepath.Join(s.socketDir, r.Endpoint)); err != nil { if err := s.connectClient(r.ResourceName, filepath.Join(s.socketDir, r.Endpoint)); err != nil {
klog.InfoS("Error connecting to device plugin client", "err", err) klog.ErrorS(err, "Error connecting to device plugin client")
return &api.Empty{}, err return &api.Empty{}, err
} }