Skip to content

Commit a8a95ae

Browse files
sarg3ntclaude
andcommitted
fix: remove duplicate HAProxy widget registration from main.go
The dashboard plugin had its own copy of HAProxy widget definitions that main.go called directly. Now that the haproxy plugin is imported and registers those same widgets during Initialize(), the explicit call in main.go caused a "widget type already registered" conflict. Removed the dashboardPlugin.RegisterHAProxyWidgets() call and converted the dashboard import to a blank import. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 523424c commit a8a95ae

1 file changed

Lines changed: 1 addition & 6 deletions

File tree

gearbox/cmd/server/main.go

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ import (
3535
// Import plugins - blank identifier triggers init() registration
3636
_ "github.com/sarg3nt/gearbox/internal/plugins/alerts"
3737
_ "github.com/sarg3nt/gearbox/internal/plugins/certificates"
38-
dashboardPlugin "github.com/sarg3nt/gearbox/internal/plugins/dashboard"
38+
_ "github.com/sarg3nt/gearbox/internal/plugins/dashboard"
3939
_ "github.com/sarg3nt/gearbox/internal/plugins/haproxy"
4040
_ "github.com/sarg3nt/gearbox/internal/plugins/logs"
4141
_ "github.com/sarg3nt/gearbox/internal/plugins/metrics"
@@ -372,11 +372,6 @@ func main() {
372372
log.Fatalf("Failed to register core widgets: %v", err)
373373
}
374374

375-
// Register HAProxy-specific widgets
376-
if err := dashboardPlugin.RegisterHAProxyWidgets(widgetRegistry); err != nil {
377-
log.Fatalf("Failed to register HAProxy widgets: %v", err)
378-
}
379-
380375
dashboardHandler := handler.NewDashboardHandler(
381376
dashboardStorage,
382377
widgetRegistry,

0 commit comments

Comments
 (0)