Skip to content

Commit 8a1421c

Browse files
kvapsclaude
andcommitted
feat(rest): stub /v1/node-connections endpoints
linstor-csi polls the inter-satellite connection matrix every status cycle. Cozystack clusters run flat L2 with no node-to-node tunnels to configure, so we return an empty list — the canonical "all healthy" answer per the upstream contract. Without the stub, every poll logs 404 noise. Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
1 parent e542fd4 commit 8a1421c

2 files changed

Lines changed: 38 additions & 0 deletions

File tree

pkg/rest/node_connections.go

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/*
2+
Copyright 2026 Cozystack contributors.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
17+
package rest
18+
19+
import (
20+
"net/http"
21+
)
22+
23+
// registerNodeConnections wires `GET /v1/node-connections`. Java LINSTOR
24+
// returns the inter-satellite connection matrix here; cozystack runs flat
25+
// L2, so we report none and let golinstor's reconciler treat that as the
26+
// healthy default. Without this stub the call 404s and linstor-csi's
27+
// status polls log an error every cycle.
28+
func (s *Server) registerNodeConnections(mux *http.ServeMux) {
29+
mux.HandleFunc("GET /v1/node-connections", handleEmptyArray)
30+
mux.HandleFunc("GET /v1/node-connections/{src}/{dst}", handleEmptyArray)
31+
}
32+
33+
// handleEmptyArray writes a JSON `[]` body — the canonical empty-list
34+
// answer that golinstor decodes into a zero-element slice.
35+
func handleEmptyArray(w http.ResponseWriter, _ *http.Request) {
36+
writeJSON(w, http.StatusOK, []struct{}{})
37+
}

pkg/rest/server.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ func (s *Server) buildMux() *http.ServeMux {
120120
s.registerRDClone(mux)
121121
s.registerSOSReport(mux)
122122
s.registerRemotes(mux)
123+
s.registerNodeConnections(mux)
123124

124125
return mux
125126
}

0 commit comments

Comments
 (0)