diff options
author | dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> | 2022-01-18 20:24:14 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-18 20:24:14 +0100 |
commit | aad60c882e16cd2c8769a49e6d9f87a040590d62 (patch) | |
tree | 3bfe1f8953b40f9beb39c69db3a7647ea6de54d2 /vendor/github.com/minio/minio-go/v7/pkg/replication | |
parent | fecca575078a21dedb0cab213dde7fd97161c0fa (diff) | |
download | matterbridge-msglm-aad60c882e16cd2c8769a49e6d9f87a040590d62.tar.gz matterbridge-msglm-aad60c882e16cd2c8769a49e6d9f87a040590d62.tar.bz2 matterbridge-msglm-aad60c882e16cd2c8769a49e6d9f87a040590d62.zip |
Bump github.com/mattermost/mattermost-server/v6 from 6.1.0 to 6.3.0 (#1686)
Bumps [github.com/mattermost/mattermost-server/v6](https://github.com/mattermost/mattermost-server) from 6.1.0 to 6.3.0.
- [Release notes](https://github.com/mattermost/mattermost-server/releases)
- [Changelog](https://github.com/mattermost/mattermost-server/blob/master/CHANGELOG.md)
- [Commits](https://github.com/mattermost/mattermost-server/compare/v6.1.0...v6.3.0)
---
updated-dependencies:
- dependency-name: github.com/mattermost/mattermost-server/v6
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Diffstat (limited to 'vendor/github.com/minio/minio-go/v7/pkg/replication')
-rw-r--r-- | vendor/github.com/minio/minio-go/v7/pkg/replication/replication.go | 28 |
1 files changed, 19 insertions, 9 deletions
diff --git a/vendor/github.com/minio/minio-go/v7/pkg/replication/replication.go b/vendor/github.com/minio/minio-go/v7/pkg/replication/replication.go index 0211f1fb..97c1492b 100644 --- a/vendor/github.com/minio/minio-go/v7/pkg/replication/replication.go +++ b/vendor/github.com/minio/minio-go/v7/pkg/replication/replication.go @@ -103,15 +103,21 @@ func (c *Config) AddRule(opts Options) error { if err != nil { return err } + var compatSw bool // true if RoleArn is used with new mc client and older minio version prior to multisite if opts.RoleArn != "" { tokens := strings.Split(opts.RoleArn, ":") if len(tokens) != 6 { return fmt.Errorf("invalid format for replication Role Arn: %v", opts.RoleArn) } - if !strings.HasPrefix(opts.RoleArn, "arn:aws:iam") { + switch { + case strings.HasPrefix(opts.RoleArn, "arn:minio:replication") && len(c.Rules) == 0: + c.Role = opts.RoleArn + compatSw = true + case strings.HasPrefix(opts.RoleArn, "arn:aws:iam"): + c.Role = opts.RoleArn + default: return fmt.Errorf("RoleArn invalid for AWS replication configuration: %v", opts.RoleArn) } - c.Role = opts.RoleArn } var status Status @@ -151,7 +157,11 @@ func (c *Config) AddRule(opts Options) error { destBucket := opts.DestBucket // ref https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-arn-format.html if btokens := strings.Split(destBucket, ":"); len(btokens) != 6 { - return fmt.Errorf("destination bucket needs to be in Arn format") + if len(btokens) == 1 && compatSw { + destBucket = fmt.Sprintf("arn:aws:s3:::%s", destBucket) + } else { + return fmt.Errorf("destination bucket needs to be in Arn format") + } } dmStatus := Disabled if opts.ReplicateDeleteMarkers != "" { @@ -228,7 +238,7 @@ func (c *Config) AddRule(opts Options) error { return err } // if replication config uses RoleArn, migrate this to the destination element as target ARN for remote bucket for MinIO configuration - if c.Role != "" && !strings.HasPrefix(c.Role, "arn:aws:iam") { + if c.Role != "" && !strings.HasPrefix(c.Role, "arn:aws:iam") && !compatSw { for i := range c.Rules { c.Rules[i].Destination.Bucket = c.Role } @@ -254,7 +264,7 @@ func (c *Config) EditRule(opts Options) error { return fmt.Errorf("rule ID missing") } // if replication config uses RoleArn, migrate this to the destination element as target ARN for remote bucket for non AWS. - if c.Role != "" && !strings.HasPrefix(c.Role, "arn:aws:iam") { + if c.Role != "" && !strings.HasPrefix(c.Role, "arn:aws:iam") && len(c.Rules) > 1 { for i := range c.Rules { c.Rules[i].Destination.Bucket = c.Role } @@ -484,10 +494,7 @@ func (r Rule) validateStatus() error { } func (r Rule) validateFilter() error { - if err := r.Filter.Validate(); err != nil { - return err - } - return nil + return r.Filter.Validate() } // Prefix - a rule can either have prefix under <filter></filter> or under @@ -712,9 +719,12 @@ type Metrics struct { FailedCount uint64 `json:"failedReplicationCount"` } +// ResyncTargetsInfo provides replication target information to resync replicated data. type ResyncTargetsInfo struct { Targets []ResyncTarget `json:"target,omitempty"` } + +// ResyncTarget provides the replica resources and resetID to initiate resync replication. type ResyncTarget struct { Arn string `json:"arn"` ResetID string `json:"resetid"` |