diff --git a/cmd/main/main.go b/cmd/main/main.go index c05c454..1f2f6b4 100644 --- a/cmd/main/main.go +++ b/cmd/main/main.go @@ -180,7 +180,7 @@ func main() { repository := repository.NewRepository(db) // Initialize Minio client - minioClient, err := minio.NewMinioClientAndInitBucket() + minioClient, _ := minio.NewMinioClientAndInitBucket() service := service.NewService(repository, minioClient, mgmtPrivateServiceClient, httpclient.NewRegistryClient(ctx)) diff --git a/pkg/minio/minio.go b/pkg/minio/minio.go index 48499a1..d5ebf2d 100644 --- a/pkg/minio/minio.go +++ b/pkg/minio/minio.go @@ -31,8 +31,13 @@ func NewMinioClientAndInitBucket() (*Minio, error) { if err != nil { return nil, err } - client, err := minio.New(cfg.Host+":"+cfg.Port, cfg.RootUser, cfg.RootUser, false) + client, err := minio.New(cfg.Host+":"+cfg.Port, cfg.RootUser, cfg.RootPwd, false) if err != nil { + // log connection error + log.Error("cannot connect to minio", + zap.String("host:port", cfg.Host+":"+cfg.Port), + zap.String("user", cfg.RootUser), + zap.String("pwd", cfg.RootPwd), zap.Error(err)) return nil, err } err = client.MakeBucket(cfg.BucketName, "us-east-1")