diff --git a/controllers/argocd_metrics_controller.go b/controllers/argocd_metrics_controller.go index 41764161b..2bb4bc21e 100644 --- a/controllers/argocd_metrics_controller.go +++ b/controllers/argocd_metrics_controller.go @@ -362,6 +362,10 @@ func (r *ArgoCDMetricsReconciler) reconcileOperatorMetricsServiceMonitor(reqLogg data, err := os.ReadFile(operatorPodNamespacePath) if err != nil { + if os.IsNotExist(err) { + reqLogger.Info(fmt.Sprintf("Unable to retrieve the operator's running namespace via '%s': you should only see this message when running within unit tests, otherwise it is an error.", operatorPodNamespacePath)) + return nil + } reqLogger.Error(err, "Error retrieving operator's running namespace") return err }