From 5fe66811006b32617eadbdfd1df769fb9a974cea Mon Sep 17 00:00:00 2001 From: "Ling Samuel (WSL)" Date: Thu, 19 Oct 2023 09:49:27 +0800 Subject: [PATCH] fix Signed-off-by: Ling Samuel (WSL) --- cmd/configure.go | 4 +--- test/cli/suites-basic/ping.go | 2 +- test/mtls/suites-basic/ping.go | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/cmd/configure.go b/cmd/configure.go index 29724f1..c4b9163 100644 --- a/cmd/configure.go +++ b/cmd/configure.go @@ -158,9 +158,7 @@ func saveConfiguration(cmd *cobra.Command) error { color.Yellow("APISIX address " + rootConfig.Server + " is configured without protocol, using HTTP") rootConfig.Server = "http://" + rootConfig.Server } - if strings.HasSuffix(rootConfig.Server, "/") { - rootConfig.Server = strings.TrimSuffix(rootConfig.Server, "/") - } + rootConfig.Server = strings.TrimSuffix(rootConfig.Server, "/") _, err = url.Parse(rootConfig.Server) if err != nil { diff --git a/test/cli/suites-basic/ping.go b/test/cli/suites-basic/ping.go index 22e51a2..f4a461a 100644 --- a/test/cli/suites-basic/ping.go +++ b/test/cli/suites-basic/ping.go @@ -13,7 +13,7 @@ var _ = ginkgo.Describe("`adc ping` tests", func() { ginkgo.It("should connect to APISIX", func() { output, err := s.Ping() gomega.Expect(err).To(gomega.BeNil()) - gomega.Expect(output).To(gomega.Equal("Connected to APISIX successfully!\n")) + gomega.Expect(output).To(gomega.Equal("Connected to backend successfully!\n")) }) }) }) diff --git a/test/mtls/suites-basic/ping.go b/test/mtls/suites-basic/ping.go index 66669ce..f3db278 100644 --- a/test/mtls/suites-basic/ping.go +++ b/test/mtls/suites-basic/ping.go @@ -13,7 +13,7 @@ var _ = ginkgo.Describe("`adc ping` tests", func() { ginkgo.It("should connect to APISIX", func() { output, err := s.Ping() gomega.Expect(err).To(gomega.BeNil()) - gomega.Expect(output).To(gomega.Equal("Connected to APISIX successfully!\n")) + gomega.Expect(output).To(gomega.Equal("Connected to backend successfully!\n")) }) }) })