From 56bcf04f9e5adc9274ae5a2f265a2e81d9baef31 Mon Sep 17 00:00:00 2001 From: Sunny Date: Sat, 27 Mar 2021 14:59:44 +0530 Subject: [PATCH] Change the log level in RemoveContainer to debug RemoveContainer() is called before a VM is created and after a VM is deleted. This results in warning logs with container or task not found for the basic operations even when nothing wrong happened. The warning could be misleading. Move the `not found` logs in RemoveContainer() to debug level to avoid such confusion. --- pkg/runtime/containerd/client.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/runtime/containerd/client.go b/pkg/runtime/containerd/client.go index 502420dba..e573ac778 100644 --- a/pkg/runtime/containerd/client.go +++ b/pkg/runtime/containerd/client.go @@ -690,7 +690,7 @@ func (cc *ctdClient) RemoveContainer(container string) error { // Remove the container if it exists cont, contLoadErr := cc.client.LoadContainer(cc.ctx, container) if errdefs.IsNotFound(contLoadErr) { - log.Warn(contLoadErr) + log.Debug(contLoadErr) return nil } else if contLoadErr != nil { return contLoadErr @@ -699,20 +699,20 @@ func (cc *ctdClient) RemoveContainer(container string) error { // Load the container's task without attaching task, taskLoadErr := cont.Task(cc.ctx, nil) if errdefs.IsNotFound(taskLoadErr) { - log.Warn(taskLoadErr) + log.Debug(taskLoadErr) } else if taskLoadErr != nil { return taskLoadErr } else { _, taskDeleteErr := task.Delete(cc.ctx) if taskDeleteErr != nil { - log.Warn(taskDeleteErr) + log.Debug(taskDeleteErr) } } // Delete the container deleteContErr := cont.Delete(cc.ctx, containerd.WithSnapshotCleanup) if errdefs.IsNotFound(contLoadErr) { - log.Warn(contLoadErr) + log.Debug(contLoadErr) } else if deleteContErr != nil { return deleteContErr }