Retry adding cluster client if one doesn't exist
@@ -165,10 +165,15 @@ func (cc *ClusterController) updateClusterStatus() error {
cluster := obj.DeepCopy()
clusterData := cc.clusterDataMap[cluster.Name]
cc.mu.RUnlock()
+ if clusterData == nil {
+ // Retry adding cluster client
+ cc.addToClusterSet(cluster)
+ clusterData = cc.clusterDataMap[cluster.Name]
if clusterData == nil {
klog.Warningf("Failed to retrieve stored data for cluster %s", cluster.Name)
continue
}
+ }
wg.Add(1)
go cc.updateIndividualClusterStatus(cluster, clusterData, &wg)
