diff --git a/federation/pkg/federation-controller/service/servicecontroller.go b/federation/pkg/federation-controller/service/servicecontroller.go index 9cdc911bc0751..a7d929e613b15 100644 --- a/federation/pkg/federation-controller/service/servicecontroller.go +++ b/federation/pkg/federation-controller/service/servicecontroller.go @@ -724,18 +724,26 @@ func (s *ServiceController) lockedUpdateDNSRecords(service *cachedService, clust if !wantsDNSRecords(service.appliedState) { return nil } + ensuredCount := 0 + unensuredCount := 0 for key := range s.clusterCache.clientMap { for _, clusterName := range clusterNames { if key == clusterName { - s.ensureDnsRecords(clusterName, service) - ensuredCount += 1 + err := s.ensureDnsRecords(clusterName, service) + if err != nil { + unensuredCount += 1 + glog.V(4).Infof("Failed to update DNS records for service %v from cluster %s: %v", service, clusterName, err) + } else { + ensuredCount += 1 + } } } } - if ensuredCount < len(clusterNames) { - return fmt.Errorf("Failed to update DNS records for %d of %d clusters for service %v due to missing clients for those clusters", - len(clusterNames)-ensuredCount, len(clusterNames), service) + missedCount := len(clusterNames) - ensuredCount - unensuredCount + if missedCount > 0 || unensuredCount > 0 { + return fmt.Errorf("Failed to update DNS records for %d clusters for service %v due to missing clients [missed count: %d] and/or failing to ensure DNS records [unensured count: %d]", + len(clusterNames), service, missedCount, unensuredCount) } return nil }