Rename replication target handler (#10142)

Rename replication target handler to a generic bucket target handler
This commit is contained in:
poornas
2020-07-28 11:50:47 -07:00
committed by GitHub
parent 27266f8a54
commit b46ab7e921
11 changed files with 208 additions and 190 deletions

View File

@@ -60,7 +60,7 @@ func (sys *BucketReplicationSys) GetConfig(ctx context.Context, bucketName strin
}
// SetTarget - sets a new minio-go client replication target for this bucket.
func (sys *BucketReplicationSys) SetTarget(ctx context.Context, bucket string, tgt *madmin.BucketReplicationTarget) error {
func (sys *BucketReplicationSys) SetTarget(ctx context.Context, bucket string, tgt *madmin.BucketTarget) error {
if globalIsGateway {
return nil
}
@@ -184,7 +184,7 @@ var getReplicationTargetInstanceTransport http.RoundTripper
var getReplicationTargetInstanceTransportOnce sync.Once
// Returns a minio-go Client configured to access remote host described in replication target config.
var getReplicationTargetClient = func(tcfg *madmin.BucketReplicationTarget) (*miniogo.Core, error) {
var getReplicationTargetClient = func(tcfg *madmin.BucketTarget) (*miniogo.Core, error) {
config := tcfg.Credentials
// if Signature version '4' use NewV4 directly.
creds := credentials.NewStaticV4(config.AccessKey, config.SecretKey, "")
@@ -198,7 +198,7 @@ var getReplicationTargetClient = func(tcfg *madmin.BucketReplicationTarget) (*mi
})
core, err := miniogo.NewCore(tcfg.Endpoint, &miniogo.Options{
Creds: creds,
Secure: tcfg.IsSSL,
Secure: tcfg.Secure,
Transport: getReplicationTargetInstanceTransport,
})
return core, err