File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -752,7 +752,13 @@ func (impl *ClusterServiceImpl) FindAllNamespacesByUserIdAndClusterId(userId int
752752 }
753753 namespaceListGroupByCLuster := impl .K8sInformerFactory .GetLatestNamespaceListGroupByCLuster ()
754754 namespaces := namespaceListGroupByCLuster [clusterBean .ClusterName ]
755-
755+ if len (namespaces ) == 0 {
756+ // TODO: Verify if this is a valid scenario, if yes, then handle it
757+ // ideally, all clusters should have at least one `default` namespace
758+ // this is a fallback scenario, for handling the namespace informer failure at start up...
759+ impl .logger .Warnw ("no namespaces found for cluster" , "clusterName" , clusterBean .ClusterName )
760+ impl .SyncNsInformer (clusterBean )
761+ }
756762 if isActionUserSuperAdmin {
757763 for namespace , value := range namespaces {
758764 if value {
You can’t perform that action at this time.
0 commit comments