Merge "Add airship container cleanup"

This commit is contained in:
Zuul 2021-06-23 21:00:43 +00:00 committed by Gerrit Code Review
commit d87c317367
2 changed files with 5 additions and 3 deletions

View File

@ -112,6 +112,11 @@ func (c *clientV1Alpha1) runAirship() error {
if err != nil {
return err
}
defer func(container Container) {
if rmErr := container.RmContainer(); rmErr != nil {
log.Printf("Failed to remove container with id '%s', err is '%s'", container.GetID(), rmErr.Error())
}
}(cont)
// this will split the env vars into the ones to be exported and the ones that have values
contEnv := runtimeutil.NewContainerEnvFromStringSlice(c.conf.Spec.EnvVars)

View File

@ -37,9 +37,6 @@ done
echo "List generated images"
ls -lth ${IMAGE_DIR}
echo "Remove the container used for image generation"
sudo docker rm $(docker ps -a -f status=exited -q)
#cleanup the directories
if [ "${CLEANUP_SERVE_DIR}" == "true" ] || [ "${CLEANUP_SERVE_DIR}" == "True" ]; then
echo "Clean directories used by image-builder"