Fix: remove the tcp protocol prefix in the endpoint string (#4059)

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
This commit is contained in:
barnettZQG
2022-05-30 20:11:55 +08:00
committed by GitHub
parent 48236f69bd
commit b13eb4adb5
3 changed files with 8 additions and 5 deletions
+3 -3
View File
@@ -960,12 +960,12 @@ options: {
fmt.Sprintf("http://%s:30229", gatewayIP),
"http://10.10.10.10",
"http://text.example.com",
"tcp://10.10.10.10:81",
"tcp://text.example.com:81",
"10.10.10.10:81",
"text.example.com:81",
// helmRelease
fmt.Sprintf("http://%s:30002", gatewayIP),
"http://ingress.domain.helm",
"tcp://1.1.1.1:80/seldon/test",
"1.1.1.1:80/seldon/test",
}
endValue, err := v.Field("list")
Expect(err).Should(BeNil())
+3
View File
@@ -58,6 +58,9 @@ func (s *ServiceEndpoint) String() string {
if (protocol == HTTPS && s.Endpoint.Port == 443) || (protocol == HTTP && s.Endpoint.Port == 80) {
return fmt.Sprintf("%s://%s%s", protocol, s.Endpoint.Host, path)
}
if protocol == "tcp" {
return fmt.Sprintf("%s:%d%s", s.Endpoint.Host, s.Endpoint.Port, path)
}
return fmt.Sprintf("%s://%s:%d%s", protocol, s.Endpoint.Host, s.Endpoint.Port, path)
}
+2 -2
View File
@@ -393,8 +393,8 @@ var _ = Describe("Test velaQL", func() {
fmt.Sprintf("http://%s:30229", gatewayIP),
"http://10.10.10.10",
"http://text.example.com",
"tcp://10.10.10.10:81",
"tcp://text.example.com:81",
"10.10.10.10:81",
"text.example.com:81",
// helmRelease
fmt.Sprintf("http://%s:30002", gatewayIP),
"http://ingress.domain.helm",