Fix null cluster name
If executing an update to the status of a federated cluster fails, we
will attempt to log the name of the cluster that failed. But if the
update failed, we will have written a new value for the cluster variable
resulting in a null cluster name.
@@ -218,7 +218,7 @@ func (cc *ClusterController) updateClusterStatus() error {
cc.clusterClusterStatusMap[cluster.Name] = *clusterStatusNew
cc.mu.Unlock()
cluster.Status = *clusterStatusNew
- cluster, err := cc.fedClient.CoreV1alpha1().FederatedClusters(util.FederationSystemNamespace).UpdateStatus(&cluster)
+ _, err = cc.fedClient.CoreV1alpha1().FederatedClusters(util.FederationSystemNamespace).UpdateStatus(&cluster)
if err != nil {
glog.Warningf("Failed to update the status of cluster: %v, error is : %v", cluster.Name, err)
// Don't return err here, as we want to continue processing remaining clusters.
