Skip to content

Commit

Permalink
chore(kb): add minio debug log (#25)
Browse files Browse the repository at this point in the history
Because

we need more minio connection info when fails

This commit

adds the log
  • Loading branch information
Yougigun authored Jun 14, 2024
1 parent 3912028 commit b8c4620
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cmd/main/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
7 changes: 6 additions & 1 deletion pkg/minio/minio.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit b8c4620

Please sign in to comment.