From 75d074146318a0e52bfa3f1832d00628d109583c Mon Sep 17 00:00:00 2001 From: Gentleelephant Date: Fri, 1 Mar 2024 16:09:41 +0800 Subject: [PATCH 1/2] fix bug Signed-off-by: Gentleelephant --- go.mod | 1 + go.sum | 2 ++ pkg/notify/notify.go | 4 +++- 3 files changed, 6 insertions(+), 1 deletion(-) 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 { From 3d1d291a12a98295f5407316e25868cc1e3cccbd Mon Sep 17 00:00:00 2001 From: Gentleelephant Date: Mon, 4 Mar 2024 13:39:22 +0800 Subject: [PATCH 2/2] add imagePullSecrets Signed-off-by: Gentleelephant --- helm/templates/notificationmanagers.yaml | 2 +- helm/templates/operator.yaml | 4 ++++ helm/values.yaml | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/helm/templates/notificationmanagers.yaml b/helm/templates/notificationmanagers.yaml index f634f49..9559425 100644 --- a/helm/templates/notificationmanagers.yaml +++ b/helm/templates/notificationmanagers.yaml @@ -39,7 +39,7 @@ spec: sidecars: tenant: {{- if .Values.kubesphere.image }} - image: {{ .Values.kubesphere.image }} + image: {{ include "global.imageRegistry" . }}{{ .Values.kubesphere.image }} {{- else }} image: {{ include "global.imageRegistry" . }}{{ .Values.notificationmanager.sidecar.image.repo }}:{{ .Values.kubesphere.version }} {{- end }} diff --git a/helm/templates/operator.yaml b/helm/templates/operator.yaml index bd6d8ea..1257476 100644 --- a/helm/templates/operator.yaml +++ b/helm/templates/operator.yaml @@ -73,3 +73,7 @@ spec: {{- toYaml .Values.operator.affinity | nindent 8 }} tolerations: {{- toYaml .Values.operator.tolerations | nindent 8 }} + {{- with .Values.global.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} diff --git a/helm/values.yaml b/helm/values.yaml index 7f4b678..1c10156 100644 --- a/helm/values.yaml +++ b/helm/values.yaml @@ -8,6 +8,7 @@ kubesphere: global: imageRegistry: "" nodeSelector: {} + imagePullSecrets: [] imageRegistryOverride: "" # value of notification-manager-operator operator: