|
|
@ -30,8 +30,6 @@ import ( |
|
|
|
"time" |
|
|
|
"time" |
|
|
|
|
|
|
|
|
|
|
|
"github.com/klauspost/compress/zip" |
|
|
|
"github.com/klauspost/compress/zip" |
|
|
|
"github.com/minio/minio/cmd/config" |
|
|
|
|
|
|
|
"github.com/minio/minio/cmd/config/notify" |
|
|
|
|
|
|
|
"github.com/minio/minio/cmd/crypto" |
|
|
|
"github.com/minio/minio/cmd/crypto" |
|
|
|
"github.com/minio/minio/cmd/logger" |
|
|
|
"github.com/minio/minio/cmd/logger" |
|
|
|
"github.com/minio/minio/pkg/event" |
|
|
|
"github.com/minio/minio/pkg/event" |
|
|
@ -589,20 +587,6 @@ func (sys *NotificationSys) PutBucketNotification(ctx context.Context, bucketNam |
|
|
|
}() |
|
|
|
}() |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// AddNotificationTargetsFromConfig - adds notification targets from server config.
|
|
|
|
|
|
|
|
func (sys *NotificationSys) AddNotificationTargetsFromConfig(cfg config.Config) error { |
|
|
|
|
|
|
|
targetList, err := notify.GetNotificationTargets(cfg, GlobalServiceDoneCh, NewCustomHTTPTransport()) |
|
|
|
|
|
|
|
if err != nil { |
|
|
|
|
|
|
|
return err |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
for _, target := range targetList.Targets() { |
|
|
|
|
|
|
|
if err = sys.targetList.Add(target); err != nil { |
|
|
|
|
|
|
|
return err |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return nil |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// AddRemoteTarget - adds event rules map, HTTP/PeerRPC client target to bucket name.
|
|
|
|
// AddRemoteTarget - adds event rules map, HTTP/PeerRPC client target to bucket name.
|
|
|
|
func (sys *NotificationSys) AddRemoteTarget(bucketName string, target event.Target, rulesMap event.RulesMap) error { |
|
|
|
func (sys *NotificationSys) AddRemoteTarget(bucketName string, target event.Target, rulesMap event.RulesMap) error { |
|
|
|
if err := sys.targetList.Add(target); err != nil { |
|
|
|
if err := sys.targetList.Add(target); err != nil { |
|
|
@ -718,6 +702,14 @@ func (sys *NotificationSys) Init(buckets []BucketInfo, objAPI ObjectLayer) error |
|
|
|
return nil |
|
|
|
return nil |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if globalConfigTargetList != nil { |
|
|
|
|
|
|
|
for _, target := range globalConfigTargetList.Targets() { |
|
|
|
|
|
|
|
if err := sys.targetList.Add(target); err != nil { |
|
|
|
|
|
|
|
return err |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
doneCh := make(chan struct{}) |
|
|
|
doneCh := make(chan struct{}) |
|
|
|
defer close(doneCh) |
|
|
|
defer close(doneCh) |
|
|
|
|
|
|
|
|
|
|
|