mirror of
https://github.com/minio/minio.git
synced 2025-01-23 12:43:16 -05:00
site removal: update site config and reload targets after update (#17327)
This commit is contained in:
parent
9ef7eda33a
commit
f86b9abf32
@ -236,6 +236,12 @@ func (c *SiteReplicationSys) Init(ctx context.Context, objAPI ObjectLayer) error
|
||||
func (c *SiteReplicationSys) loadFromDisk(ctx context.Context, objAPI ObjectLayer) error {
|
||||
buf, err := readConfig(ctx, objAPI, getSRStateFilePath())
|
||||
if err != nil {
|
||||
if errors.Is(err, errConfigNotFound) {
|
||||
c.Lock()
|
||||
defer c.Unlock()
|
||||
c.state = srState{}
|
||||
c.enabled = false
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
@ -2272,6 +2278,17 @@ func (c *SiteReplicationSys) RemoveRemoteTargetsForEndpoint(ctx context.Context,
|
||||
}
|
||||
return err
|
||||
}
|
||||
targets, terr := globalBucketTargetSys.ListBucketTargets(ctx, t.SourceBucket)
|
||||
if terr != nil {
|
||||
return err
|
||||
}
|
||||
tgtBytes, terr := json.Marshal(&targets)
|
||||
if terr != nil {
|
||||
return err
|
||||
}
|
||||
if _, err = globalBucketMetadataSys.Update(ctx, t.SourceBucket, bucketTargetsFile, tgtBytes); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user