about summary refs log tree commit diff
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/nixery/main.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/tools/nixery/main.go b/tools/nixery/main.go
index 54dd8ab4d136..a78250d4c4f8 100644
--- a/tools/nixery/main.go
+++ b/tools/nixery/main.go
@@ -367,6 +367,11 @@ type registryHandler struct {
 }
 
 func (h *registryHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
+	// Acknowledge that we speak V2 with an empty response
+	if r.RequestURI == "/v2/" {
+		return
+	}
+
 	// Serve the manifest (straight from Nix)
 	manifestMatches := manifestRegex.FindStringSubmatch(r.RequestURI)
 	if len(manifestMatches) == 3 {
@@ -436,12 +441,7 @@ func main() {
 
 	log.Printf("Starting Kubernetes Nix controller on port %s\n", cfg.port)
 
-	// Acknowledge that we speak V2
-	http.HandleFunc("/v2", func(w http.ResponseWriter, r *http.Request) {
-		fmt.Fprintln(w)
-	})
-
-	// All other /v2/ requests belong to the registry handler.
+	// All /v2/ requests belong to the registry handler.
 	http.Handle("/v2/", &registryHandler{
 		cfg:    cfg,
 		ctx:    &ctx,