diff --git a/cmd/archeio/main.go b/cmd/archeio/main.go index a93dc2e..f23c5d8 100644 --- a/cmd/archeio/main.go +++ b/cmd/archeio/main.go @@ -79,14 +79,12 @@ func main() { func makeHandler(upstreamRegistry string) http.Handler { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { // right now we just need to serve a redirect, but all - // valid requests should be at /v2/ or /v1/, so we leave this check + // valid requests should be at /v2/, so we leave this check // in the future we will selectively redirect clients to different copies path := r.URL.Path switch { case strings.HasPrefix(path, "/v2/"): doV2(w, r, upstreamRegistry) - case strings.HasPrefix(path, "/v1/"): - doV1(w, r, upstreamRegistry) default: klog.V(2).InfoS("unknown request", "path", path) http.NotFound(w, r) @@ -99,10 +97,3 @@ func doV2(w http.ResponseWriter, r *http.Request, upstreamRegistry string) { klog.V(2).InfoS("v2 request", "path", path) http.Redirect(w, r, upstreamRegistry+path, http.StatusPermanentRedirect) } - -// TODO: should we even be supporting v1 API anymore? -func doV1(w http.ResponseWriter, r *http.Request, upstreamRegistry string) { - path := r.URL.Path - klog.V(2).InfoS("v1 request", "path", path) - http.Redirect(w, r, upstreamRegistry+path, http.StatusPermanentRedirect) -}