Skip to content

Commit c8feb3a

Browse files
authored
Merge pull request #993 from fluxcd/cleanup-minio-test-container
purge minio test container at the end of tests
2 parents c741805 + 3a17461 commit c8feb3a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

pkg/minio/minio_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ import (
2929
"github.com/google/uuid"
3030
miniov7 "github.com/minio/minio-go/v7"
3131
"github.com/ory/dockertest/v3"
32+
"github.com/ory/dockertest/v3/docker"
3233
"gotest.tools/assert"
3334
corev1 "k8s.io/api/core/v1"
3435
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@@ -125,6 +126,8 @@ func TestMain(m *testing.M) {
125126
"MINIO_ROOT_PASSWORD=" + testMinioRootPassword,
126127
},
127128
Cmd: []string{"server", "/data", "--console-address", ":9001"},
129+
}, func(config *docker.HostConfig) {
130+
config.AutoRemove = true
128131
})
129132
if err != nil {
130133
log.Fatalf("could not start resource: %s", err)
@@ -168,6 +171,7 @@ func TestMain(m *testing.M) {
168171
run := m.Run()
169172
removeObjectFromBucket(ctx)
170173
deleteBucket(ctx)
174+
purgeResource()
171175
os.Exit(run)
172176
}
173177

0 commit comments

Comments
 (0)