From 1c8d74aa4ff2fcac66fe882ce7a76dba99c4f730 Mon Sep 17 00:00:00 2001
From: Travis Ralston <travpc@gmail.com>
Date: Thu, 10 Aug 2023 23:20:11 -0600
Subject: [PATCH] Don't try to delete things that don't matter

---
 Dockerfile                      | 4 +++-
 test/test_internals/deps_mmr.go | 3 +--
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/Dockerfile b/Dockerfile
index eb9e87cd..781a4213 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,7 +1,6 @@
 # ---- Stage 0 ----
 # Builds media repo binaries
 FROM golang:1.20-alpine AS builder
-LABEL io.t2bot.mmr.cleanup="true"
 
 # Install build dependencies
 RUN apk add --no-cache git musl-dev dos2unix build-base
@@ -11,6 +10,9 @@ COPY . /opt
 RUN dos2unix ./build.sh ./docker/run.sh && chmod 744 ./build.sh
 RUN ./build.sh
 
+# the label is applied last so we don't pollute the image list with a weird amount of labelled images
+LABEL io.t2bot.mmr.cleanup="true"
+
 # ---- Stage 1 ----
 # Final runtime stage.
 FROM alpine
diff --git a/test/test_internals/deps_mmr.go b/test/test_internals/deps_mmr.go
index 17d49c60..ff098637 100644
--- a/test/test_internals/deps_mmr.go
+++ b/test/test_internals/deps_mmr.go
@@ -205,8 +205,7 @@ func TeardownMmrCaches() {
 				if _, err = dockerProvider.Client().ImageRemove(context.Background(), imageName, types.ImageRemoveOptions{
 					PruneChildren: true,
 				}); err != nil {
-					log.Printf("Error removing MMR cached build image '%s': %s", imageName, err.Error())
-					log.Println()
+					log.Fatalf("Error removing MMR cached build image '%s': %s", imageName, err.Error())
 				}
 			}
 			if images, err := dockerProvider.Client().ImageList(context.Background(), types.ImageListOptions{All: true}); err != nil {
-- 
GitLab