fix: Fix test cases in registry/nacos/mcpserver/watcher_test.go (#3869)

Signed-off-by: CH3CHO <ch3cho@qq.com>
This commit is contained in:
Kent Dong
2026-05-25 15:15:03 +08:00
committed by GitHub
parent b8ff815100
commit e6fc09b14f

View File

@@ -134,6 +134,8 @@ func Test_Watcher(t *testing.T) {
Ip: "127.0.0.1",
Port: 8080,
Metadata: map[string]string{"protocol": "http"},
Enable: true,
Healthy: true,
},
},
},
@@ -188,6 +190,7 @@ func Test_Watcher(t *testing.T) {
Meta: config.Meta{
GroupVersionKind: gvk.ServiceEntry,
Name: fmt.Sprintf("%s-%s", provider.IstioMcpAutoGeneratedSeName, strings.TrimSuffix(dataId, ".json")),
Namespace: "mcp",
},
Spec: &v1alpha3.ServiceEntry{
Hosts: []string{"explore.DEFAULT-GROUP.public.nacos"},
@@ -266,6 +269,8 @@ func Test_Watcher(t *testing.T) {
Ip: "example.com",
Port: 8080,
Metadata: map[string]string{"protocol": "http"},
Enable: true,
Healthy: true,
},
},
},
@@ -320,6 +325,7 @@ func Test_Watcher(t *testing.T) {
Meta: config.Meta{
GroupVersionKind: gvk.ServiceEntry,
Name: fmt.Sprintf("%s-%s", provider.IstioMcpAutoGeneratedSeName, strings.TrimSuffix(dataId, ".json")),
Namespace: "mcp",
},
Spec: &v1alpha3.ServiceEntry{
Hosts: []string{"explore.DEFAULT-GROUP.public.nacos"},
@@ -422,6 +428,8 @@ func Test_Watcher(t *testing.T) {
Ip: "example.com",
Port: 8080,
Metadata: map[string]string{"protocol": "https"},
Enable: true,
Healthy: true,
},
},
},
@@ -476,6 +484,7 @@ func Test_Watcher(t *testing.T) {
Meta: config.Meta{
GroupVersionKind: gvk.ServiceEntry,
Name: fmt.Sprintf("%s-%s", provider.IstioMcpAutoGeneratedSeName, strings.TrimSuffix(dataId, ".json")),
Namespace: "mcp",
},
Spec: &v1alpha3.ServiceEntry{
Hosts: []string{"explore.DEFAULT-GROUP.public.nacos"},