fix: Run Reconcile after SetPort so Central routes to correct port
Reconcile() was called before SetPort(), so getRunningPort() returned the default 5055 (Wild Cloud's port) instead of 15055. Moved Reconcile() after SetPort(port) so Central's config-driven HAProxy route points to the actual running port. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
9
main.go
9
main.go
@@ -116,10 +116,6 @@ func main() {
|
|||||||
api.StartCentralStatusBroadcaster(startTime)
|
api.StartCentralStatusBroadcaster(startTime)
|
||||||
slog.Info("central status broadcaster started")
|
slog.Info("central status broadcaster started")
|
||||||
|
|
||||||
// Run initial reconciliation so Central's own domain (from config) gets
|
|
||||||
// DNS + HAProxy routes even with zero registered services.
|
|
||||||
api.Reconcile()
|
|
||||||
|
|
||||||
api.StartDDNS(ctx)
|
api.StartDDNS(ctx)
|
||||||
|
|
||||||
router := mux.NewRouter()
|
router := mux.NewRouter()
|
||||||
@@ -154,8 +150,11 @@ func main() {
|
|||||||
fmt.Sscanf(v, "%d", &port)
|
fmt.Sscanf(v, "%d", &port)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Tell the API what port it's running on (used for config-driven HAProxy routes)
|
// Tell the API what port it's running on and run initial reconciliation.
|
||||||
|
// Must happen AFTER port is known so Central's config-driven HAProxy
|
||||||
|
// route points to the correct port.
|
||||||
api.SetPort(port)
|
api.SetPort(port)
|
||||||
|
api.Reconcile()
|
||||||
|
|
||||||
addr := fmt.Sprintf("%s:%d", host, port)
|
addr := fmt.Sprintf("%s:%d", host, port)
|
||||||
slog.Info("wild-central started", "addr", addr, "version", Version)
|
slog.Info("wild-central started", "addr", addr, "version", Version)
|
||||||
|
|||||||
Reference in New Issue
Block a user