Skip to content

Commit

Permalink
fix: small typo & import fixes (#273)
Browse files Browse the repository at this point in the history
  • Loading branch information
mojtaba-esk authored Apr 17, 2024
1 parent 738c810 commit 070dbea
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions pkg/minio/minio.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (
"net"
"time"

"github.com/minio/minio-go/v7"
miniogo "github.com/minio/minio-go/v7"
"github.com/minio/minio-go/v7/pkg/credentials"
"github.com/sirupsen/logrus"
Expand Down Expand Up @@ -296,7 +295,7 @@ func (m *Minio) createOrUpdateService(ctx context.Context) error {
return nil
}

func (m *Minio) createBucketIfNotExists(ctx context.Context, cli *minio.Client, bucketName string) error {
func (m *Minio) createBucketIfNotExists(ctx context.Context, cli *miniogo.Client, bucketName string) error {
exists, err := cli.BucketExists(ctx, bucketName)
if err != nil {
return fmt.Errorf("failed to check if bucket exists: %v", err)
Expand All @@ -305,7 +304,7 @@ func (m *Minio) createBucketIfNotExists(ctx context.Context, cli *minio.Client,
return nil
}

if err := cli.MakeBucket(ctx, bucketName, minio.MakeBucketOptions{}); err != nil {
if err := cli.MakeBucket(ctx, bucketName, miniogo.MakeBucketOptions{}); err != nil {
return fmt.Errorf("failed to create bucket: %v", err)
}
logrus.Debugf("Bucket `%s` created successfully.", bucketName)
Expand Down Expand Up @@ -383,10 +382,10 @@ func (m *Minio) waitForMinioService(ctx context.Context) error {
}
} else if service.Spec.Type == v1.ServiceTypeNodePort {
if service.Spec.Ports[0].NodePort == 0 {
return fmt.Errorf("NodePort for Minio service is not set")
return fmt.Errorf("NodePort for minio service is not set")
}
} else if len(service.Spec.ExternalIPs) == 0 {
return fmt.Errorf("External IPs for Minio service are not set")
return fmt.Errorf("external IPs for minio service are not set")
}

// Check if Minio is reachable
Expand Down Expand Up @@ -471,9 +470,8 @@ func (m *Minio) createPVC(ctx context.Context, pvcName string, storageSize strin
if err != nil {
return fmt.Errorf("failed to create PersistentVolume: %v", err)
}

logrus.Debugf("PersistentVolume `%s` created successfully.", existingPV.Name)
}
logrus.Debugf("PersistentVolume `%s` created successfully.", existingPV.Name)

// Create PVC with the existing or newly created PV
pvc := &v1.PersistentVolumeClaim{
Expand Down

0 comments on commit 070dbea

Please sign in to comment.