add support for disabling relay via environment variable

This commit is contained in:
Zoltán Papp
2026-02-18 18:59:56 +01:00
parent 93f530637d
commit 2ea7fb7b21
4 changed files with 27 additions and 1 deletions
+3 -1
View File
@@ -942,7 +942,9 @@ func (e *Engine) handleRelayUpdate(update *mgmProto.RelayConfig) error {
return fmt.Errorf("update relay token: %w", err)
}
e.relayManager.UpdateServerURLs(update.Urls)
if !relayClient.IsDisableRelay() {
e.relayManager.UpdateServerURLs(update.Urls)
}
// Just in case the agent started with an MGM server where the relay was disabled but was later enabled.
// We can ignore all errors because the guard will manage the reconnection retries.