fix invalid ai-proxy cluster (#1947)

Co-authored-by: Kent Dong <ch3cho@qq.com>
This commit is contained in:
澄潭
2025-03-25 11:20:20 +08:00
committed by GitHub
parent 71029d791d
commit 8978a4e0e0
2 changed files with 4 additions and 21 deletions

View File

@@ -1,17 +0,0 @@
package provider
import "fmt"
type plainCluster struct {
serviceName string
servicePort int64
hostName string
}
func (c plainCluster) ClusterName() string {
return fmt.Sprintf("outbound|%d||%s", c.servicePort, c.serviceName)
}
func (c plainCluster) HostName() string {
return c.hostName
}

View File

@@ -95,10 +95,10 @@ func createContextCache(providerConfig *ProviderConfig) *contextCache {
return nil
}
fileUrlObj, _ := url.Parse(contextConfig.fileUrl)
cluster := plainCluster{
serviceName: contextConfig.serviceName,
servicePort: contextConfig.servicePort,
hostName: fileUrlObj.Host,
cluster := wrapper.FQDNCluster{
FQDN: contextConfig.serviceName,
Port: contextConfig.servicePort,
Host: fileUrlObj.Host,
}
return &contextCache{
client: wrapper.NewClusterClient(cluster),