mirror of
https://github.com/minio/minio.git
synced 2025-11-07 12:52:58 -05:00
fix: change SetRemoteTarget API to allow editing remote target granularly (#12175)
Currently, only credentials could be updated with `mc admin bucket remote edit`. Allow updating synchronous replication flag, path, bandwidth and healthcheck duration on buckets, and a flag to disable proxying in active-active replication.
This commit is contained in:
committed by
GitHub
parent
77f9c71133
commit
632252ff1d
@@ -204,6 +204,21 @@ func (sys *BucketTargetSys) GetRemoteTargetClient(ctx context.Context, arn strin
|
||||
return sys.arnRemotesMap[arn]
|
||||
}
|
||||
|
||||
// GetRemoteBucketTargetByArn returns BucketTarget for a ARN
|
||||
func (sys *BucketTargetSys) GetRemoteBucketTargetByArn(ctx context.Context, bucket, arn string) madmin.BucketTarget {
|
||||
sys.RLock()
|
||||
defer sys.RUnlock()
|
||||
var tgt madmin.BucketTarget
|
||||
for _, t := range sys.targetsMap[bucket] {
|
||||
if t.Arn == arn {
|
||||
tgt = t.Clone()
|
||||
tgt.Credentials = t.Credentials
|
||||
return tgt
|
||||
}
|
||||
}
|
||||
return tgt
|
||||
}
|
||||
|
||||
// NewBucketTargetSys - creates new replication system.
|
||||
func NewBucketTargetSys() *BucketTargetSys {
|
||||
return &BucketTargetSys{
|
||||
@@ -315,6 +330,7 @@ func (sys *BucketTargetSys) getRemoteTargetClient(tcfg *madmin.BucketTarget) (*T
|
||||
replicateSync: tcfg.ReplicationSync,
|
||||
Bucket: tcfg.TargetBucket,
|
||||
StorageClass: tcfg.StorageClass,
|
||||
disableProxy: tcfg.DisableProxy,
|
||||
}
|
||||
go tc.healthCheck()
|
||||
return tc, nil
|
||||
@@ -393,6 +409,7 @@ type TargetClient struct {
|
||||
Bucket string // remote bucket target
|
||||
replicateSync bool
|
||||
StorageClass string // storage class on remote
|
||||
disableProxy bool
|
||||
}
|
||||
|
||||
func (tc *TargetClient) isOffline() bool {
|
||||
|
||||
Reference in New Issue
Block a user