From d6eb9dd77e2df1b78dd82afd7ea76592207dea32 Mon Sep 17 00:00:00 2001 From: Chris Doherty Date: Mon, 27 Jun 2022 20:14:58 -0400 Subject: [PATCH] Deprecate packet endpoints /_packet/version and /_packet/health are deprecated in favor of /versionz and /heathz respectively. Signed-off-by: Chris Doherty --- http/server.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/http/server.go b/http/server.go index c0b7ff60..446adda6 100644 --- a/http/server.go +++ b/http/server.go @@ -31,8 +31,14 @@ func Serve( logger.Info("in the http serve func") var mux http.ServeMux mux.Handle("/metrics", promhttp.Handler()) - mux.Handle("/_packet/healthcheck", HealthCheckHandler(logger, client, start)) - mux.Handle("/_packet/version", VersionHandler(logger)) + + healthCheckHandler := HealthCheckHandler(logger, client, start) + mux.Handle("/_packet/healthcheck", healthCheckHandler) // deprecated + mux.Handle("/healthz", healthCheckHandler) + + versionHandler := VersionHandler(logger) + mux.Handle("/_packet/version", versionHandler) // deprecated + mux.Handle("/versionz", versionHandler) ec2MetadataHandler := otelhttp.WithRouteTag("/2009-04-04", EC2MetadataHandler(logger, client)) mux.Handle("/2009-04-04/", ec2MetadataHandler)