mirror of
https://github.com/kubevela/kubevela.git
synced 2026-08-18 03:56:36 +00:00
* Chore: wrong endpoint for LoadBalancer type service(revert #4729) Signed-off-by: barnettZQG <barnett.zqg@gmail.com> * Fix: change the unit test Signed-off-by: barnettZQG <barnett.zqg@gmail.com> Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
This commit is contained in:
@@ -211,10 +211,10 @@ func generatorFromService(service corev1.Service, selectorNodeIP func() string,
|
||||
appp := judgeAppProtocol(port.Port)
|
||||
for _, ingress := range service.Status.LoadBalancer.Ingress {
|
||||
if ingress.Hostname != "" {
|
||||
serviceEndpoints = append(serviceEndpoints, formatEndpoint(ingress.Hostname, appp, port.Name, port.Protocol, port.NodePort, false))
|
||||
serviceEndpoints = append(serviceEndpoints, formatEndpoint(ingress.Hostname, appp, port.Name, port.Protocol, port.Port, false))
|
||||
}
|
||||
if ingress.IP != "" {
|
||||
serviceEndpoints = append(serviceEndpoints, formatEndpoint(ingress.IP, appp, port.Name, port.Protocol, port.NodePort, false))
|
||||
serviceEndpoints = append(serviceEndpoints, formatEndpoint(ingress.IP, appp, port.Name, port.Protocol, port.Port, false))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -167,7 +167,7 @@ var _ = Describe("Test Query Provider", func() {
|
||||
{
|
||||
"name": "seldon-ambassador-2",
|
||||
"ports": []corev1.ServicePort{
|
||||
{Port: 80, TargetPort: intstr.FromInt(80), Name: "80port", NodePort: 30010},
|
||||
{Port: 80, TargetPort: intstr.FromInt(80), Name: "80port"},
|
||||
},
|
||||
"type": corev1.ServiceTypeLoadBalancer,
|
||||
"status": corev1.ServiceStatus{
|
||||
@@ -251,11 +251,11 @@ var _ = Describe("Test Query Provider", func() {
|
||||
Expect(err).Should(BeNil())
|
||||
|
||||
urls := []string{
|
||||
"http://1.1.1.1:30010/seldon/default/sdep2",
|
||||
"http://1.1.1.1/seldon/default/sdep2",
|
||||
"http://clusterip-2.default",
|
||||
"clusterip-2.default:81",
|
||||
"http://2.2.2.2:30020",
|
||||
"http://1.1.1.1:30010",
|
||||
"http://2.2.2.2:8080",
|
||||
"http://1.1.1.1",
|
||||
}
|
||||
endValue, err := v.Field("list")
|
||||
Expect(err).Should(BeNil())
|
||||
|
||||
@@ -946,13 +946,13 @@ options: {
|
||||
"https://ingress.domain.path/test",
|
||||
"https://ingress.domain.path/test2",
|
||||
fmt.Sprintf("http://%s:30229", gatewayIP),
|
||||
"http://10.10.10.10:30080",
|
||||
"http://text.example.com:30080",
|
||||
"10.10.10.10:30081",
|
||||
"text.example.com:30081",
|
||||
"http://10.10.10.10",
|
||||
"http://text.example.com",
|
||||
"10.10.10.10:81",
|
||||
"text.example.com:81",
|
||||
fmt.Sprintf("http://%s:30002", gatewayIP),
|
||||
"http://ingress.domain.helm",
|
||||
"http://1.1.1.1:30011/seldon/default/sdep",
|
||||
"http://1.1.1.1/seldon/default/sdep",
|
||||
"http://gateway.domain",
|
||||
"http://gateway.domain/api",
|
||||
"https://demo.kubevela.net",
|
||||
|
||||
@@ -436,10 +436,10 @@ var _ = Describe("Test velaQL", func() {
|
||||
"https://ingress.domain.path/test",
|
||||
"https://ingress.domain.path/test2",
|
||||
fmt.Sprintf("http://%s:30229", gatewayIP),
|
||||
"http://10.10.10.10:30180",
|
||||
"http://text.example.com:30180",
|
||||
"10.10.10.10:30181",
|
||||
"text.example.com:30181",
|
||||
"http://10.10.10.10",
|
||||
"http://text.example.com",
|
||||
"10.10.10.10:81",
|
||||
"text.example.com:81",
|
||||
// helmRelease
|
||||
fmt.Sprintf("http://%s:30002", gatewayIP),
|
||||
"http://ingress.domain.helm",
|
||||
|
||||
Reference in New Issue
Block a user