From e68025ae42866dd81ee2dbc8729d6bbc6bcb7c1f Mon Sep 17 00:00:00 2001 From: Ti Chi Robot Date: Fri, 24 Jun 2022 12:22:37 +0800 Subject: [PATCH] Makefile: disable swagger server (#4934) (#5176) close tikv/pd#4932, ref tikv/pd#4934 Signed-off-by: ti-chi-bot Signed-off-by: nolouch Co-authored-by: ShuNing Co-authored-by: nolouch --- Makefile | 4 ++-- go.mod | 1 - go.sum | 1 - pkg/swaggerserver/empty_handler.go | 2 +- 4 files changed, 3 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index c5c752a1159..33cea9bbfdd 100644 --- a/Makefile +++ b/Makefile @@ -48,7 +48,7 @@ ifneq "$(PD_EDITION)" "Enterprise" endif endif -ifneq ($(SWAGGER), 0) +ifeq ($(SWAGGER), 1) BUILD_TAGS += swagger_server endif @@ -98,7 +98,7 @@ build: pd-server pd-ctl pd-recover tools: pd-tso-bench pd-analysis pd-heartbeat-bench PD_SERVER_DEP := -ifneq ($(SWAGGER), 0) +ifeq ($(SWAGGER), 1) PD_SERVER_DEP += swagger-spec endif ifneq ($(DASHBOARD_DISTRIBUTION_DIR),) diff --git a/go.mod b/go.mod index dec44382857..bdea6674086 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,6 @@ go 1.16 require ( github.com/AlekSi/gocov-xml v1.0.0 github.com/BurntSushi/toml v0.3.1 - github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 github.com/aws/aws-sdk-go v1.35.3 github.com/axw/gocov v1.0.0 github.com/cakturk/go-netstat v0.0.0-20200220111822-e5b49efee7a5 diff --git a/go.sum b/go.sum index 4b95e4dcfc8..df4ba8b0fb9 100644 --- a/go.sum +++ b/go.sum @@ -24,7 +24,6 @@ github.com/VividCortex/mysqlerr v1.0.0/go.mod h1:xERx8E4tBhLvpjzdUyQiSfUxeMcATEQ github.com/Xeoncross/go-aesctr-with-hmac v0.0.0-20200623134604-12b17a7ff502 h1:L8IbaI/W6h5Cwgh0n4zGeZpVK78r/jBf9ASurHo9+/o= github.com/Xeoncross/go-aesctr-with-hmac v0.0.0-20200623134604-12b17a7ff502/go.mod h1:pmnBM9bxWSiHvC/gSWunUIyDvGn33EkP2CUjxFKtTTM= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= -github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 h1:JYp7IbQjafoB+tBA3gMyHYHrpOtNuDiK/uB5uXxq5wM= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alvaroloes/enumer v1.1.2/go.mod h1:FxrjvuXoDAx9isTJrv4c+T410zFi0DtXIT0m65DJ+Wo= diff --git a/pkg/swaggerserver/empty_handler.go b/pkg/swaggerserver/empty_handler.go index e5fa6633662..888593b215e 100644 --- a/pkg/swaggerserver/empty_handler.go +++ b/pkg/swaggerserver/empty_handler.go @@ -24,6 +24,6 @@ import ( func handler() http.Handler { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - _, _ = io.WriteString(w, "Swagger UI is not built. Try `make` without `SWAGGER=0`.\n") + _, _ = io.WriteString(w, "Swagger UI is not built. Try `make` without `SWAGGER=1`.\n") }) }