fix: use madmin.Credentials for gateway interface (#12493)

the main reason is to de-couple the project from
depending on MinIO's internal/auth package, other
changes will subsequently follow.
This commit is contained in:
Harshavardhana
2021-06-14 12:53:49 -07:00
committed by GitHub
parent 0d1d26a4ea
commit 0d1fb10940
7 changed files with 19 additions and 55 deletions

View File

@@ -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()
}