Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: cluster namespace list informer #6069

Merged
merged 1 commit into from
Nov 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion pkg/cluster/ClusterService.go
Original file line number Diff line number Diff line change
Expand Up @@ -752,7 +752,13 @@ func (impl *ClusterServiceImpl) FindAllNamespacesByUserIdAndClusterId(userId int
}
namespaceListGroupByCLuster := impl.K8sInformerFactory.GetLatestNamespaceListGroupByCLuster()
namespaces := namespaceListGroupByCLuster[clusterBean.ClusterName]

if len(namespaces) == 0 {
// TODO: Verify if this is a valid scenario, if yes, then handle it
// ideally, all clusters should have at least one `default` namespace
// this is a fallback scenario, for handling the namespace informer failure at start up...
impl.logger.Warnw("no namespaces found for cluster", "clusterName", clusterBean.ClusterName)
impl.SyncNsInformer(clusterBean)
}
if isActionUserSuperAdmin {
for namespace, value := range namespaces {
if value {
Expand Down