Skip to content

Commit dc7cee9

Browse files
committed
update
1 parent eec1fc9 commit dc7cee9

File tree

2 files changed

+4
-252
lines changed

2 files changed

+4
-252
lines changed

services/config_generator.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,6 @@ type MiddlewareWithPriority struct {
427427
Priority int
428428
}
429429

430-
// Rest of the existing methods remain the same...
431430
func (cg *ConfigGenerator) processMiddlewares(config *TraefikConfig) error {
432431
rows, err := cg.db.Query("SELECT id, name, type, config FROM middlewares")
433432
if err != nil {
@@ -499,7 +498,6 @@ func (cg *ConfigGenerator) processServices(config *TraefikConfig) error {
499498
return rows.Err()
500499
}
501500

502-
// Additional helper functions and existing methods...
503501
func stringSliceContains(slice []string, str string) bool {
504502
for _, s := range slice {
505503
if s == str {
@@ -545,11 +543,12 @@ func (cg *ConfigGenerator) processResourcesWithServices(config *TraefikConfig) e
545543

546544
resourceDataMap := make(map[string]ResourceData)
547545

546+
// FIXED QUERY: Use correct table alias 'rs' consistently
548547
query := `
549548
SELECT DISTINCT
550549
r.id, r.host, r.service_id, r.entrypoints, r.tls_domains, r.custom_headers, r.source_type, r.router_priority,
551550
rm.middleware_id, rm.priority as middleware_priority,
552-
rsc.custom_service_id
551+
rs.service_id as custom_service_id
553552
FROM resources r
554553
LEFT JOIN resource_middlewares rm ON r.id = rm.resource_id
555554
LEFT JOIN resource_services rs ON r.id = rs.resource_id
@@ -723,10 +722,11 @@ func (cg *ConfigGenerator) processTCPRouters(config *TraefikConfig) error {
723722
activeDSConfig = models.DataSourceConfig{Type: "pangolin"}
724723
}
725724

725+
// FIXED QUERY: Use correct table alias 'rs' consistently
726726
query := `
727727
SELECT DISTINCT
728728
r.id, r.host, r.service_id, r.entrypoints, r.source_type, r.router_priority,
729-
rsc.custom_service_id
729+
rs.service_id as custom_service_id
730730
FROM resources r
731731
LEFT JOIN resource_services rs ON r.id = rs.resource_id
732732
WHERE r.tcp_enabled = 1

tools/migrate_config.go

Lines changed: 0 additions & 248 deletions
This file was deleted.

0 commit comments

Comments
 (0)