Copilot commented on code in PR #827:
URL: https://github.com/apache/solr-operator/pull/827#discussion_r4455674977


##########
controllers/solrprometheusexporter_controller.go:
##########
@@ -92,6 +92,27 @@ func (r *SolrPrometheusExporterReconciler) Reconcile(ctx 
context.Context, req ct
 
        requeueOrNot := ctrl.Result{}
 
+       // Get the ZkConnectionString to connect to
+       solrConnectionInfo := util.SolrConnectionInfo{}
+       var solrCloudImage *solrv1beta1.ContainerImage
+       if solrConnectionInfo, solrCloudImage, err = getSolrConnectionInfo(ctx, 
r, prometheusExporter); err != nil {
+               return requeueOrNot, err
+       }
+
+       // Solr 10 removed the Prometheus exporter, and Solr 10's metrics API 
only serves the Prometheus format,
+       // so neither a Solr 10+ exporter image nor a referenced Solr 10+ 
SolrCloud can work.
+       // Don't create or update any resources for such an exporter. An 
existing Deployment is left alone, but marked not ready.
+       if msg := unsupportedExporterSolrVersion(prometheusExporter.Spec.Image, 
solrCloudImage); msg != "" {
+               logger.Error(nil, msg)
+               r.Recorder.Event(prometheusExporter, corev1.EventTypeWarning, 
"UnsupportedSolrVersion", msg)
+               if prometheusExporter.Status.Ready {
+                       originalPrometheusExporter := 
prometheusExporter.DeepCopy()
+                       prometheusExporter.Status.Ready = false
+                       return reconcile.Result{}, r.Status().Patch(ctx, 
prometheusExporter, client.MergeFrom(originalPrometheusExporter))
+               }
+               return reconcile.Result{}, nil

Review Comment:
   A rejected exporter referencing a SolrCloud in another namespace will not 
resume reconciliation when that cloud changes to a supported version: this 
return schedules no retry, and `indexAndWatchForSolrClouds` only searches the 
cloud's own namespace. The same watch limitation can leave an existing 
cross-namespace exporter marked ready after its cloud upgrades to Solr 10. 
Index references by the cloud's effective namespace and name, query exporters 
across namespaces, and test both transitions.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to