Skip to content

Modern Docker Management, Designed for Everyone

fix: add missing swarm-identity endpoint in edge tunnel (#2886)

Kyle Mendell1dc7a354ceff
diff --git a/backend/internal/bootstrap/router_bootstrap.go b/backend/internal/bootstrap/router_bootstrap.go
index a3e837bf6..fc4b7b07e 100644
--- a/backend/internal/bootstrap/router_bootstrap.go
+++ b/backend/internal/bootstrap/router_bootstrap.go
@@ -2,6 +2,7 @@ package bootstrap
import (
"context"
+ "errors"
"log/slog"
"net"
"net/http"
@@ -211,7 +212,11 @@ func setupRouter(ctx context.Context, cfg *config.Config, appServices *di.Servic
}
if err := frontend.RegisterFrontend(e); err != nil {
- slog.Error("Failed to register frontend", "error", err)
+ if errors.Is(err, frontend.ErrFrontendNotIncluded) {
+ slog.Debug("Frontend not included in this build; skipping frontend registration")
+ } else {
+ slog.Error("Failed to register frontend", "error", err)
+ }
}
return e, tunnelServer
diff --git a/backend/pkg/libarcane/edge/commands.go b/backend/pkg/libarcane/edge/commands.go
index f7ac6ce68..8a36ec882 100644
--- a/backend/pkg/libarcane/edge/commands.go
+++ b/backend/pkg/libarcane/edge/commands.go
@@ -17,6 +17,7 @@ var commandRoutes = []commandRoute{
{Method: http.MethodGet, PathPattern: "/api/health", CommandName: "system.health"},
{Method: http.MethodHead, PathPattern: "/api/health", CommandName: "system.health"},
{Method: http.MethodGet, PathPattern: "/api/app-version", CommandName: "system.version"},
+ {Method: http.MethodGet, PathPattern: "/api/swarm/node-identity", CommandName: "swarm.node_identity"},
{Method: http.MethodPost, PathPattern: "/api/container-registries/sync", CommandName: "container_registry.sync"},
{Method: http.MethodPost, PathPattern: "/api/git-repositories/sync", CommandName: "git_repository.sync"},
diff --git a/backend/pkg/libarcane/edge/commands_test.go b/backend/pkg/libarcane/edge/commands_test.go
index 130b36a63..2ee27d822 100644
--- a/backend/pkg/libarcane/edge/commands_test.go
+++ b/backend/pkg/libarcane/edge/commands_test.go
@@ -31,6 +31,7 @@ func TestResolveEdgeCommandName(t *testing.T) {
{name: "activity history clear", method: "DELETE", path: "/api/environments/0/activities/history", command: "activity.history.clear", shouldHit: true},
{name: "activity stream remains manager local", method: "GET", path: "/api/environments/0/activities/stream?limit=50", shouldHit: false},
{name: "health", method: "HEAD", path: "/api/environments/0/system/health", command: "system.health", shouldHit: true},
+ {name: "swarm node identity", method: "GET", path: "/api/swarm/node-identity", command: "swarm.node_identity", shouldHit: true},
{name: "unknown", method: "PATCH", path: "/api/environments/0/containers", shouldHit: false},
}