Skip to content

Commit

Permalink
Merge pull request #272 from wanjunlei/master
Browse files Browse the repository at this point in the history
Continue to update tenants when some clusters fail
  • Loading branch information
benjaminhuo authored Jul 3, 2024
2 parents 9a34483 + e7f861f commit b7c6a5d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion sidecar/kubesphere/4.0.0/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Use of this source code is governed by a Apache license
# that can be found in the LICENSE file.

IMG ?= kubesphere/notification-tenant-sidecar:v4.0.1
IMG ?= kubesphere/notification-tenant-sidecar:v4.0.2
AMD64 ?= -amd64

all: docker-build
Expand Down
6 changes: 4 additions & 2 deletions sidecar/kubesphere/4.0.0/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func NewBackend(host, username, password string, interval time.Duration, batchSi

func (b *Backend) FromNamespace(cluster, ns string) []string {
cm, ok := b.tenants[cluster]
if !ok {
if !ok || cm == nil {
return nil
}

Expand Down Expand Up @@ -92,7 +92,9 @@ func (b *Backend) reload() {
for _, cluster := range clusters {
m, err := getTenantInfoFromCluster(cluster, users)
if err != nil {
return
klog.Errorf("get tenant info from %s error, %s", cluster, err.Error())
tenants[cluster] = b.tenants[cluster]
continue
}

tenants[cluster] = m
Expand Down

0 comments on commit b7c6a5d

Please sign in to comment.