diff --git a/go.mod b/go.mod index 3665f5a..a252af8 100644 --- a/go.mod +++ b/go.mod @@ -54,6 +54,7 @@ require ( github.com/beorn7/perks v1.0.1 // indirect github.com/cespare/xxhash/v2 v2.2.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect + github.com/duke-git/lancet/v2 v2.2.9 // indirect github.com/emicklei/go-restful/v3 v3.9.0 // indirect github.com/evanphx/json-patch/v5 v5.6.0 // indirect github.com/fsnotify/fsnotify v1.6.0 // indirect diff --git a/go.sum b/go.sum index f372bee..a04e1ed 100644 --- a/go.sum +++ b/go.sum @@ -64,6 +64,8 @@ github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ3 github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/duke-git/lancet/v2 v2.2.9 h1:ik02ZrFg/OU0lduLfmNqo73mAhpY2a3Fm1RUFcoEtqk= +github.com/duke-git/lancet/v2 v2.2.9/go.mod h1:zGa2R4xswg6EG9I6WnyubDbFO/+A/RROxIbXcwryTsc= github.com/emicklei/go-restful v2.16.0+incompatible h1:rgqiKNjTnFQA6kkhFe16D8epTksy9HQ1MyrbDXSdYhM= github.com/emicklei/go-restful v2.16.0+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= github.com/emicklei/go-restful/v3 v3.9.0 h1:XwGDlfxEnQZzuopoqxwSEllNcCOM9DhhFyhFIIGKwxE= diff --git a/pkg/notify/notify.go b/pkg/notify/notify.go index 9739bf8..13411db 100644 --- a/pkg/notify/notify.go +++ b/pkg/notify/notify.go @@ -4,6 +4,8 @@ import ( "context" "sync" + "github.com/duke-git/lancet/v2/convertor" + "github.com/go-kit/kit/log" "github.com/go-kit/kit/log/level" "github.com/kubesphere/notification-manager/pkg/async" @@ -97,7 +99,7 @@ func (s *notifyStage) Exec(ctx context.Context, l log.Logger, data interface{}) group := async.NewGroup(ctx) for k, v := range input { receiver := k - ds := v + ds := convertor.DeepClone(v) s.addExtensionLabels(receiver, ds) nf, err := factories[receiver.GetType()](l, receiver, s.notifierCtl) if err != nil {