Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(docker): do not fail docker image cleanup #224

Merged
merged 1 commit into from
Aug 22, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

package com.aws.greengrass.testing.features;

import com.aws.greengrass.testing.api.device.exception.CommandExecutionException;
import com.aws.greengrass.testing.api.device.model.CommandInput;
import com.aws.greengrass.testing.platform.Platform;
import io.cucumber.guice.ScenarioScoped;
Expand Down Expand Up @@ -81,8 +82,17 @@ private void checkDockerImagePresence(String image, Predicate<Set<String>> valid
}
}

/**
* Cleanup after executing steps.
*/
@After
public void removeCreatedImages() {
createdImages.forEach(this::removeDockerImage);
for (String createdImage : createdImages) {
try {
removeDockerImage(createdImage);
} catch (CommandExecutionException e) {
LOGGER.debug("Could not remove docker image {}", createdImage, e);
}
}
}
}
Loading