Skip to content

Commit

Permalink
fix case sensitivity of removed image check
Browse files Browse the repository at this point in the history
  • Loading branch information
bendavies committed Apr 29, 2019
1 parent aabe65e commit 811fbcc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion agent/engine/docker_image_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,7 @@ func (imageManager *dockerImageManager) deleteImage(ctx context.Context, imageID
seelog.Infof("Removing Image: %s", imageID)
err := imageManager.client.RemoveImage(ctx, imageID, dockerclient.RemoveImageTimeout)
if err != nil {
if strings.Contains(err.Error(), imageNotFoundForDeletionError) {
if strings.Contains(strings.ToLower(err.Error()), imageNotFoundForDeletionError) {
seelog.Errorf("Image already removed from the instance: %v", err)
} else {
seelog.Errorf("Error removing Image %v - %v", imageID, err)
Expand Down
2 changes: 1 addition & 1 deletion agent/engine/docker_image_manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1118,7 +1118,7 @@ func TestDeleteImageNotFoundError(t *testing.T) {
}
imageState, _ := imageManager.getImageState(imageInspected.ID)
client.EXPECT().RemoveImage(gomock.Any(), container.Image, dockerclient.RemoveImageTimeout).Return(
errors.New("no such image: " + container.Image))
errors.New("No such image: " + container.Image))
ctx, cancel := context.WithCancel(context.TODO())
defer cancel()
imageManager.deleteImage(ctx, container.Image, imageState)
Expand Down

0 comments on commit 811fbcc

Please sign in to comment.