Skip to content

Commit ce4b76c

Browse files
committed
During resync, remove clusters that are no longer found
Signed-off-by: Vince Prignano <[email protected]>
1 parent 61b68cb commit ce4b76c

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

pkg/manager/internal.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ import (
3131
"k8s.io/apimachinery/pkg/api/meta"
3232
"k8s.io/apimachinery/pkg/runtime"
3333
kerrors "k8s.io/apimachinery/pkg/util/errors"
34+
"k8s.io/apimachinery/pkg/util/sets"
3435
"k8s.io/apimachinery/pkg/util/wait"
3536
"k8s.io/apimachinery/pkg/watch"
3637
"k8s.io/client-go/rest"
@@ -630,6 +631,15 @@ func (cm *controllerManager) Start(ctx context.Context) (err error) { //nolint:g
630631
return err
631632
}
632633
}
634+
clusterListSet := sets.New(clusterList...)
635+
for name := range cm.logicalClusters {
636+
if clusterListSet.Has(name) {
637+
continue
638+
}
639+
if err := cm.removeLogicalCluster(name); err != nil {
640+
return err
641+
}
642+
}
633643
cm.syncClusterAwareRunnables()
634644
return nil
635645
}

0 commit comments

Comments
 (0)