fix(backend): run make format

This commit is contained in:
Łukasz Mierzwa
2026-05-12 16:01:43 +01:00
committed by Łukasz Mierzwa
parent 799f2cc2c1
commit 0b68886c43
10 changed files with 37 additions and 19 deletions

View File

@@ -327,7 +327,8 @@ func countAlerts(uri string, timeout time.Duration, transport http.RoundTripper,
ctx,
[]string{`{__name__="ALERTS_FOR_STATE"}`},
time.Now().Add(time.Minute*-5),
time.Now())
time.Now(),
)
if err != nil {
return nil, fmt.Errorf("failed to query Prometheus for label names: %w", err)
}

View File

@@ -191,7 +191,8 @@ func TestAlertHistory(t *testing.T) {
},
values: generateIntSlice(0, 1, 24),
},
}, time.Hour),
}, time.Hour,
),
}),
},
},
@@ -302,7 +303,8 @@ func TestAlertHistory(t *testing.T) {
},
values: generateIntSlice(0, 1, 24),
},
}, time.Hour),
}, time.Hour,
),
}),
},
},
@@ -373,7 +375,8 @@ func TestAlertHistory(t *testing.T) {
},
values: generateIntSlice(0, 1, 24),
},
}, time.Hour),
}, time.Hour,
),
}),
},
},
@@ -432,7 +435,8 @@ func TestAlertHistory(t *testing.T) {
},
values: generateIntSlice(0, 1, 24),
},
}, time.Hour),
}, time.Hour,
),
}),
},
},
@@ -491,7 +495,8 @@ func TestAlertHistory(t *testing.T) {
},
values: generateIntSlice(0, 1, 24),
},
}, time.Hour),
}, time.Hour,
),
}),
},
},
@@ -559,7 +564,8 @@ func TestAlertHistory(t *testing.T) {
},
values: generateIntSlice(0, 1, 24),
},
}, time.Hour),
}, time.Hour,
),
}),
},
},

View File

@@ -177,13 +177,15 @@ func setupRouterProxyHandlers(router *chi.Mux, alertmanager *alertmanager.Alertm
proxy := NewAlertmanagerProxy(alertmanager)
router.Post(
proxyPath(alertmanager.Name, "/api/v2/silences"),
handlePostRequest(alertmanager, http.StripPrefix(proxyPathPrefix(alertmanager.Name), proxy)))
handlePostRequest(alertmanager, http.StripPrefix(proxyPathPrefix(alertmanager.Name), proxy)),
)
router.Delete(
proxyPath(alertmanager.Name, "/api/v2/silence/{id}"),
http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
h := http.StripPrefix(proxyPathPrefix(alertmanager.Name), proxy)
h.ServeHTTP(w, r)
}))
}),
)
}
// this fixes a problem with go-chi usage of RawPath