From dc0f006f962f39f8b023470881b209c18c0e797f Mon Sep 17 00:00:00 2001 From: YaoZengzeng Date: Wed, 26 Sep 2018 14:15:21 +0800 Subject: [PATCH] bugfix: minor fix for error misuse Signed-off-by: YaoZengzeng --- cri/v1alpha1/cri.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cri/v1alpha1/cri.go b/cri/v1alpha1/cri.go index 5dda38b2b..24d12ce30 100644 --- a/cri/v1alpha1/cri.go +++ b/cri/v1alpha1/cri.go @@ -588,7 +588,7 @@ func (c *CriManager) CreateContainer(ctx context.Context, r *runtime.CreateConta // If the container failed to be created, clean up the container. if err != nil { removeErr := c.ContainerMgr.Remove(ctx, containerID, &apitypes.ContainerRemoveOptions{Volumes: true, Force: true}) - if err != nil { + if removeErr != nil { logrus.Errorf("failed to remove the container when creating container failed: %v", removeErr) } }