fix loadbalancing when two container have the same alias

This commit is contained in:
yusing
2025-02-17 11:16:34 +08:00
parent a8a209f0b0
commit 75d272be14
4 changed files with 14 additions and 11 deletions

View File

@@ -97,7 +97,7 @@ func (r *ReveseProxyRoute) String() string {
// Start implements task.TaskStarter.
func (r *ReveseProxyRoute) Start(parent task.Parent) gperr.Error {
if existing, ok := routes.GetHTTPRoute(r.TargetName()); ok {
if existing, ok := routes.GetHTTPRoute(r.TargetName()); ok && !r.UseLoadBalance() {
return gperr.Errorf("route already exists: from provider %s and %s", existing.ProviderName(), r.ProviderName())
}
r.task = parent.Subtask("http."+r.TargetName(), false)

View File

@@ -100,7 +100,7 @@ func (r *Route) Validate() (err gperr.Error) {
}
if !r.UseHealthCheck() && (r.UseLoadBalance() || r.UseIdleWatcher()) {
errs.Adds("healthCheck.disable cannot be true when loadbalancer or idlewatcher is enabled")
errs.Adds("cannot disable healthcheck when loadbalancer or idle watcher is enabled")
}
if errs.HasError() {