diff --git a/cmd/gateway-interface.go b/cmd/gateway-interface.go index b18ad0326..960f16ca2 100644 --- a/cmd/gateway-interface.go +++ b/cmd/gateway-interface.go @@ -17,9 +17,7 @@ package cmd -import ( - "github.com/minio/minio/internal/auth" -) +import "github.com/minio/madmin-go" // GatewayMinioSysTmp prefix is used in Azure/GCS gateway for save metadata sent by Initialize Multipart Upload API. const ( @@ -37,8 +35,5 @@ type Gateway interface { Name() string // NewGatewayLayer returns a new ObjectLayer. - NewGatewayLayer(creds auth.Credentials) (ObjectLayer, error) - - // Returns true if gateway is ready for production. - Production() bool + NewGatewayLayer(creds madmin.Credentials) (ObjectLayer, error) } diff --git a/cmd/gateway-main.go b/cmd/gateway-main.go index c63ce8929..ea423922e 100644 --- a/cmd/gateway-main.go +++ b/cmd/gateway-main.go @@ -29,7 +29,7 @@ import ( "github.com/gorilla/mux" "github.com/minio/cli" - "github.com/minio/minio/internal/color" + "github.com/minio/madmin-go" xhttp "github.com/minio/minio/internal/http" "github.com/minio/minio/internal/logger" "github.com/minio/pkg/certs" @@ -294,7 +294,10 @@ func StartGateway(ctx *cli.Context, gw Gateway) { signal.Notify(globalOSSignalCh, os.Interrupt, syscall.SIGTERM, syscall.SIGQUIT) - newObject, err := gw.NewGatewayLayer(globalActiveCred) + newObject, err := gw.NewGatewayLayer(madmin.Credentials{ + AccessKey: globalActiveCred.AccessKey, + SecretKey: globalActiveCred.SecretKey, + }) if err != nil { globalHTTPServer.Shutdown() logger.FatalIf(err, "Unable to initialize gateway backend") @@ -350,16 +353,12 @@ func StartGateway(ctx *cli.Context, gw Gateway) { verifyObjectLayerFeatures("gateway "+gatewayName, newObject) // Prints the formatted startup message once object layer is initialized. - if !globalCLIContext.Quiet { - mode := globalMinioModeGatewayPrefix + gatewayName + if !globalCLIContext.Quiet && !globalInplaceUpdateDisabled { // Check update mode. - checkUpdate(mode) - - // Print a warning message if gateway is not ready for production before the startup banner. - if !gw.Production() { - logStartupMessage(color.Yellow(" *** Warning: Not Ready for Production ***")) - } + checkUpdate(globalMinioModeGatewayPrefix + gatewayName) + } + if !globalCLIContext.Quiet { // Print gateway startup message. printGatewayStartupMessage(getAPIEndpoints(), gatewayName) } diff --git a/cmd/gateway/azure/gateway-azure.go b/cmd/gateway/azure/gateway-azure.go index b194835c3..ccebc68e7 100644 --- a/cmd/gateway/azure/gateway-azure.go +++ b/cmd/gateway/azure/gateway-azure.go @@ -43,7 +43,6 @@ import ( "github.com/minio/madmin-go" miniogopolicy "github.com/minio/minio-go/v7/pkg/policy" minio "github.com/minio/minio/cmd" - "github.com/minio/minio/internal/auth" "github.com/minio/minio/internal/logger" "github.com/minio/pkg/bucket/policy" "github.com/minio/pkg/bucket/policy/condition" @@ -138,14 +137,14 @@ func (g *Azure) Name() string { } // NewGatewayLayer initializes azure blob storage client and returns AzureObjects. -func (g *Azure) NewGatewayLayer(creds auth.Credentials) (minio.ObjectLayer, error) { +func (g *Azure) NewGatewayLayer(creds madmin.Credentials) (minio.ObjectLayer, error) { var err error // Override credentials from the Azure storage environment variables if specified if acc, key := env.Get("AZURE_STORAGE_ACCOUNT", creds.AccessKey), env.Get("AZURE_STORAGE_KEY", creds.SecretKey); acc != "" && key != "" { - creds, err = auth.CreateCredentials(acc, key) - if err != nil { - return nil, err + creds = madmin.Credentials{ + AccessKey: acc, + SecretKey: key, } } @@ -244,11 +243,6 @@ func parseStorageEndpoint(host string, accountName string) (*url.URL, error) { return url.Parse(endpoint) } -// Production - Azure gateway is production ready. -func (g *Azure) Production() bool { - return true -} - // s3MetaToAzureProperties converts metadata meant for S3 PUT/COPY // object into Azure data structures - BlobMetadata and // BlobProperties. diff --git a/cmd/gateway/gcs/gateway-gcs.go b/cmd/gateway/gcs/gateway-gcs.go index 326943fd4..520ac8213 100644 --- a/cmd/gateway/gcs/gateway-gcs.go +++ b/cmd/gateway/gcs/gateway-gcs.go @@ -40,7 +40,6 @@ import ( "github.com/minio/madmin-go" miniogopolicy "github.com/minio/minio-go/v7/pkg/policy" minio "github.com/minio/minio/cmd" - "github.com/minio/minio/internal/auth" "github.com/minio/minio/internal/logger" "github.com/minio/pkg/bucket/policy" "github.com/minio/pkg/bucket/policy/condition" @@ -164,7 +163,7 @@ func (g *GCS) Name() string { } // NewGatewayLayer returns gcs ObjectLayer. -func (g *GCS) NewGatewayLayer(creds auth.Credentials) (minio.ObjectLayer, error) { +func (g *GCS) NewGatewayLayer(creds madmin.Credentials) (minio.ObjectLayer, error) { ctx := minio.GlobalContext var err error @@ -206,11 +205,6 @@ func (g *GCS) NewGatewayLayer(creds auth.Credentials) (minio.ObjectLayer, error) return gcs, nil } -// Production - GCS gateway is production ready. -func (g *GCS) Production() bool { - return true -} - // Stored in gcs.json - Contents of this file is not used anywhere. It can be // used for debugging purposes. type gcsMultipartMetaV1 struct { diff --git a/cmd/gateway/hdfs/gateway-hdfs.go b/cmd/gateway/hdfs/gateway-hdfs.go index ff52014c8..b8214cd7f 100644 --- a/cmd/gateway/hdfs/gateway-hdfs.go +++ b/cmd/gateway/hdfs/gateway-hdfs.go @@ -41,7 +41,6 @@ import ( "github.com/minio/madmin-go" "github.com/minio/minio-go/v7/pkg/s3utils" minio "github.com/minio/minio/cmd" - "github.com/minio/minio/internal/auth" "github.com/minio/minio/internal/logger" xnet "github.com/minio/minio/internal/net" "github.com/minio/pkg/env" @@ -158,7 +157,7 @@ func getKerberosClient() (*krb.Client, error) { } // NewGatewayLayer returns hdfs gatewaylayer. -func (g *HDFS) NewGatewayLayer(creds auth.Credentials) (minio.ObjectLayer, error) { +func (g *HDFS) NewGatewayLayer(creds madmin.Credentials) (minio.ObjectLayer, error) { dialFunc := (&net.Dialer{ Timeout: 30 * time.Second, KeepAlive: 30 * time.Second, @@ -223,11 +222,6 @@ func (g *HDFS) NewGatewayLayer(creds auth.Credentials) (minio.ObjectLayer, error return &hdfsObjects{clnt: clnt, subPath: commonPath, listPool: minio.NewTreeWalkPool(time.Minute * 30)}, nil } -// Production - hdfs gateway is production ready. -func (g *HDFS) Production() bool { - return true -} - func (n *hdfsObjects) Shutdown(ctx context.Context) error { return n.clnt.Close() } diff --git a/cmd/gateway/nas/gateway-nas.go b/cmd/gateway/nas/gateway-nas.go index faa275e1b..16c45db9a 100644 --- a/cmd/gateway/nas/gateway-nas.go +++ b/cmd/gateway/nas/gateway-nas.go @@ -22,7 +22,6 @@ import ( "github.com/minio/cli" "github.com/minio/madmin-go" minio "github.com/minio/minio/cmd" - "github.com/minio/minio/internal/auth" ) func init() { @@ -86,7 +85,7 @@ func (g *NAS) Name() string { } // NewGatewayLayer returns nas gatewaylayer. -func (g *NAS) NewGatewayLayer(creds auth.Credentials) (minio.ObjectLayer, error) { +func (g *NAS) NewGatewayLayer(creds madmin.Credentials) (minio.ObjectLayer, error) { var err error newObject, err := minio.NewFSObjectLayer(g.path) if err != nil { @@ -95,11 +94,6 @@ func (g *NAS) NewGatewayLayer(creds auth.Credentials) (minio.ObjectLayer, error) return &nasObjects{newObject}, nil } -// Production - nas gateway is production ready. -func (g *NAS) Production() bool { - return true -} - // IsListenSupported returns whether listen bucket notification is applicable for this gateway. func (n *nasObjects) IsListenSupported() bool { return false diff --git a/cmd/gateway/s3/gateway-s3.go b/cmd/gateway/s3/gateway-s3.go index 556d5da3e..8e3065fdf 100644 --- a/cmd/gateway/s3/gateway-s3.go +++ b/cmd/gateway/s3/gateway-s3.go @@ -34,7 +34,6 @@ import ( "github.com/minio/minio-go/v7/pkg/s3utils" "github.com/minio/minio-go/v7/pkg/tags" minio "github.com/minio/minio/cmd" - "github.com/minio/minio/internal/auth" xhttp "github.com/minio/minio/internal/http" "github.com/minio/minio/internal/logger" "github.com/minio/pkg/bucket/policy" @@ -205,7 +204,7 @@ func newS3(urlStr string, tripper http.RoundTripper) (*miniogo.Core, error) { } // NewGatewayLayer returns s3 ObjectLayer. -func (g *S3) NewGatewayLayer(creds auth.Credentials) (minio.ObjectLayer, error) { +func (g *S3) NewGatewayLayer(creds madmin.Credentials) (minio.ObjectLayer, error) { metrics := minio.NewMetrics() t := &minio.MetricsTransport{ @@ -250,11 +249,6 @@ func (g *S3) NewGatewayLayer(creds auth.Credentials) (minio.ObjectLayer, error) return &s, nil } -// Production - s3 gateway is production ready. -func (g *S3) Production() bool { - return true -} - // s3Objects implements gateway for MinIO and S3 compatible object storage servers. type s3Objects struct { minio.GatewayUnsupported