Skip to content

Commit

Permalink
Merge pull request #993 from fluxcd/cleanup-minio-test-container
Browse files Browse the repository at this point in the history
purge minio test container at the end of tests
  • Loading branch information
darkowlzz authored Dec 23, 2022
2 parents c741805 + 3a17461 commit c8feb3a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/minio/minio_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import (
"github.com/google/uuid"
miniov7 "github.com/minio/minio-go/v7"
"github.com/ory/dockertest/v3"
"github.com/ory/dockertest/v3/docker"
"gotest.tools/assert"
corev1 "k8s.io/api/core/v1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
Expand Down Expand Up @@ -125,6 +126,8 @@ func TestMain(m *testing.M) {
"MINIO_ROOT_PASSWORD=" + testMinioRootPassword,
},
Cmd: []string{"server", "/data", "--console-address", ":9001"},
}, func(config *docker.HostConfig) {
config.AutoRemove = true
})
if err != nil {
log.Fatalf("could not start resource: %s", err)
Expand Down Expand Up @@ -168,6 +171,7 @@ func TestMain(m *testing.M) {
run := m.Run()
removeObjectFromBucket(ctx)
deleteBucket(ctx)
purgeResource()
os.Exit(run)
}

Expand Down

0 comments on commit c8feb3a

Please sign in to comment.