Fix version in APIv1 deprecation notice (#3815)
Signed-off-by: George Robinson <george.robinson@grafana.com>
This commit is contained in:
parent
dc1e1a2b88
commit
7106bcc1ab
|
@ -162,7 +162,7 @@ func New(opts Options) (*API, error) {
|
||||||
// true for the concurrency limit, with the exception that it is only applied to
|
// true for the concurrency limit, with the exception that it is only applied to
|
||||||
// GET requests.
|
// GET requests.
|
||||||
func (api *API) Register(r *route.Router, routePrefix string) *http.ServeMux {
|
func (api *API) Register(r *route.Router, routePrefix string) *http.ServeMux {
|
||||||
// TODO(gotjosh) API V1 was removed as of version 0.28, when we reach 1.0.0 we should removed these deprecation warnings.
|
// TODO(gotjosh) API V1 was removed as of version 0.27, when we reach 1.0.0 we should removed these deprecation warnings.
|
||||||
api.deprecationRouter.Register(r.WithPrefix("/api/v1"))
|
api.deprecationRouter.Register(r.WithPrefix("/api/v1"))
|
||||||
|
|
||||||
mux := http.NewServeMux()
|
mux := http.NewServeMux()
|
||||||
|
|
|
@ -23,7 +23,7 @@ type Alerts struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewAlerts returns an *Alerts struct for the given API version.
|
// NewAlerts returns an *Alerts struct for the given API version.
|
||||||
// Since v1 was deprecated in 0.28, v2 is now hardcoded.
|
// Since v1 was deprecated in 0.27, v2 is now hardcoded.
|
||||||
func NewAlerts(r prometheus.Registerer) *Alerts {
|
func NewAlerts(r prometheus.Registerer) *Alerts {
|
||||||
numReceivedAlerts := prometheus.NewCounterVec(prometheus.CounterOpts{
|
numReceivedAlerts := prometheus.NewCounterVec(prometheus.CounterOpts{
|
||||||
Name: "alertmanager_alerts_received_total",
|
Name: "alertmanager_alerts_received_total",
|
||||||
|
|
|
@ -54,7 +54,7 @@ func (dr *V1DeprecationRouter) deprecationHandler(w http.ResponseWriter, req *ht
|
||||||
Error string `json:"error"`
|
Error string `json:"error"`
|
||||||
}{
|
}{
|
||||||
"deprecated",
|
"deprecated",
|
||||||
"The Alertmanager v1 API was deprecated in version 0.16.0 and is removed as of version 0.28.0 - please use the equivalent route in the v2 API",
|
"The Alertmanager v1 API was deprecated in version 0.16.0 and is removed as of version 0.27.0 - please use the equivalent route in the v2 API",
|
||||||
}
|
}
|
||||||
|
|
||||||
w.Header().Set("Content-Type", "application/json")
|
w.Header().Set("Content-Type", "application/json")
|
||||||
|
|
Loading…
Reference in New Issue