Skip to content

Commit

Permalink
cmd/gateway: create MinioMetaBucket when it doesn't exist. (#4383)
Browse files Browse the repository at this point in the history
  • Loading branch information
zhijian-pro authored Jan 26, 2024
1 parent df27905 commit c374650
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions cmd/gateway.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
package cmd

import (
"context"
"errors"
_ "net/http/pprof"
"os"
"os/signal"
Expand Down Expand Up @@ -140,6 +142,12 @@ func gateway(c *cli.Context) error {
return err
}

if _, err := jfsGateway.GetBucketInfo(context.Background(), minio.MinioMetaBucket); errors.As(err, &minio.BucketNotFound{}) {
if err := jfsGateway.MakeBucketWithLocation(context.Background(), minio.MinioMetaBucket, minio.BucketOptions{}); err != nil {
logger.Fatalf("init MinioMetaBucket error %s: %s", minio.MinioMetaBucket, err)
}
}

args := []string{"server", "--address", listenAddr, "--anonymous"}
if c.Bool("no-banner") {
args = append(args, "--quiet")
Expand Down

0 comments on commit c374650

Please sign in to comment.