Skip to content

Commit

Permalink
Remove minio region
Browse files Browse the repository at this point in the history
Twice recently the minio region seemed to have changed
unsetting it seems to work consistently.

Signed-off-by: Paulo Gomes <paulo.gomes@weave.works>
  • Loading branch information
Paulo Gomes committed May 10, 2022
1 parent 39f1c5c commit a18d24e
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions pkg/minio/minio_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,13 @@ import (
const (
objectName string = "test.yaml"
objectEtag string = "2020beab5f1711919157756379622d1d"
region string = "us-west-2"
)

var (
minioClient *MinioClient
bucketName = "test-bucket-minio" + uuid.New().String()
secret = corev1.Secret{
firstFailure = true
minioClient *MinioClient
bucketName = "test-bucket-minio" + uuid.New().String()
secret = corev1.Secret{
ObjectMeta: v1.ObjectMeta{
Name: "minio-secret",
Namespace: "default",
Expand All @@ -72,7 +72,6 @@ var (
Spec: sourcev1.BucketSpec{
BucketName: bucketName,
Endpoint: "play.min.io",
Region: region,
Provider: "generic",
Insecure: true,
SecretRef: &meta.LocalObjectReference{
Expand All @@ -88,7 +87,6 @@ var (
Spec: sourcev1.BucketSpec{
BucketName: bucketName,
Endpoint: "play.min.io",
Region: region,
Provider: "aws",
Insecure: true,
},
Expand Down Expand Up @@ -226,11 +224,14 @@ func TestValidateSecret(t *testing.T) {
}

func createBucket(ctx context.Context) {
if err := minioClient.Client.MakeBucket(ctx, bucketName, miniov7.MakeBucketOptions{Region: region}); err != nil {
if err := minioClient.Client.MakeBucket(ctx, bucketName, miniov7.MakeBucketOptions{}); err != nil {
exists, errBucketExists := minioClient.BucketExists(ctx, bucketName)
if errBucketExists == nil && exists {
deleteBucket(ctx)
} else {
return
} else if firstFailure {
firstFailure = false

log.Fatalln(err)
}
}
Expand Down

0 comments on commit a18d24e

Please sign in to comment.