Skip to content

Commit e85f0f1

Browse files
committed
fix: inline error check in previous tests
Signed-off-by: Bence Csati <[email protected]>
1 parent b832782 commit e85f0f1

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

e2e/logging_metrics_monitoring/logging_metrics_monitoring_test.go

+5-7
Original file line numberDiff line numberDiff line change
@@ -252,22 +252,20 @@ func TestLoggingMetrics_Monitoring(t *testing.T) {
252252
func installPrometheusOperator(c common.Cluster) error {
253253
manager := helm.New(c.KubeConfigFilePath())
254254

255-
err := manager.RunRepo(helm.WithArgs("add", "prometheus-community", "https://prometheus-community.github.io/helm-charts"))
256-
if err != nil {
257-
return fmt.Errorf("failed to add prometheus-community repo: %w", err)
255+
if err := manager.RunRepo(helm.WithArgs("add", "prometheus-community", "https://prometheus-community.github.io/helm-charts")); err != nil {
256+
return fmt.Errorf("failed to add prometheus-community repo: %v", err)
258257
}
259258

260-
err = manager.RunInstall(
259+
if err := manager.RunInstall(
261260
helm.WithName("prometheus"),
262261
helm.WithChart("prometheus-community/kube-prometheus-stack"),
263262
helm.WithArgs("--create-namespace"),
264263
helm.WithNamespace("monitoring"),
265264
helm.WithArgs("--set", "prometheus.prometheusSpec.serviceMonitorSelectorNilUsesHelmValues=false"),
266265
helm.WithArgs("--set", "prometheus.prometheusSpec.podMonitorSelectorNilUsesHelmValues=false"),
267266
helm.WithWait(),
268-
)
269-
if err != nil {
270-
return fmt.Errorf("failed to install prometheus-operator: %w", err)
267+
); err != nil {
268+
return fmt.Errorf("failed to install prometheus: %v", err)
271269
}
272270

273271
return nil

0 commit comments

Comments
 (0)