Skip to content

Commit

Permalink
Fix 'Unable to retrieve current OCP version: Malformed version' when …
Browse files Browse the repository at this point in the history
…running unit tests (#729)

* Fix 'Unable to retrieve current OCP version: Malformed version' when running unit tests

Signed-off-by: Jonathan West <[email protected]>

* Fix 'Unable to retrieve current OCP version: Malformed version' when running unit tests

Signed-off-by: Jonathan West <[email protected]>

---------

Signed-off-by: Jonathan West <[email protected]>
  • Loading branch information
jgwest authored Jun 18, 2024
1 parent e32261b commit b134408
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions controllers/argocd_metrics_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit b134408

Please sign in to comment.