🌱 Do setup API only if a kairos block is defined

Signed-off-by: Ettore Di Giacinto <mudler@mocaccino.org>
This commit is contained in:
Ettore Di Giacinto
2022-12-07 16:41:24 +01:00
parent 301b69cfa5
commit 5c5c432594

View File

@@ -105,7 +105,7 @@ func Bootstrap(e *pluggable.Event) pluggable.EventResponse {
if err := SetupVPN(services.EdgeVPNDefaultInstance, cfg.APIAddress, "/", true, providerConfig); err != nil {
return ErrorEvent("Failed setup VPN: %s", err.Error())
}
} else {
} else if kairosBlockisDefined {
logger.Info("Configuring API")
if err := SetupAPI(cfg.APIAddress, "/", true, providerConfig); err != nil {
return ErrorEvent("Failed setup VPN: %s", err.Error())