Skip to content

Commit 96fde2c

Browse files
committed
Return nil at the end of createScrapeConfigs
Currently the function returns the latest value of the "err" variable. This isn't what should be happening. If we want to return an error, we should do so in one of the `if err != nil {}` blocks. When the function gets to the end, it should be considered as successfuly executed.
1 parent f2c8dd9 commit 96fde2c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

controllers/metricstorage_controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -647,7 +647,7 @@ func (r *MetricStorageReconciler) createScrapeConfigs(
647647
}
648648

649649
instance.Status.Conditions.MarkTrue(telemetryv1.ScrapeConfigReadyCondition, condition.ReadyMessage)
650-
return ctrl.Result{}, err
650+
return ctrl.Result{}, nil
651651
}
652652

653653
func getNodeExporterTargets(nodes []ConnectionInfo) ([]metricstorage.LabeledTarget, []metricstorage.LabeledTarget) {

0 commit comments

Comments
 (0)