You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This closes the last definition-side gap in the CSI MVP slice. With this
slice, linstor-csi's CreateVolume flow round-trips end-to-end at the REST
layer:
1. POST /v1/resource-groups/{rg}/spawn → RD + VDs (existing)
2. POST /v1/resource-definitions/{rd}/autoplace → place_count Resources
3. … (Phase 3: satellite reconciles those Resources)
The Phase 2.5 autoplacer:
- Merges request select_filter on top of the parent RG's stored filter,
request fields winning. Empty request inherits everything.
- Filters StoragePool list by kind (skips DISKLESS), name, list, and
node-name list.
- Skips nodes that already host a replica of this RD; creates Resources
up to PlaceCount; returns 409 if there aren't enough candidates.
- Phase 3's autoplacer will weigh free capacity, traits, anti-affinity;
this stub is good enough to drive linstor-csi against the in-cluster
oracle today.
Also adds explicit single-resource placement:
- POST /v1/resource-definitions/{rd}/resources (linstor-csi diskless toggles)
- DELETE /v1/resource-definitions/{rd}/resources/{node}
Tests (5 contract):
- pick-requested-count, conflict-when-insufficient, missing-RD→404,
inherits-RG-filter, resource-create-then-delete round-trip.
PLAN.md: tick the boxes that were already done but I had not synced —
Phase 1 closed (apiconsts via golinstor, linstor-common submodule),
Phase 2 definition side closed; Phase 2.5 autoplacer/resource POST done;
reconcilers + Phase 3 satellite still ⬜.
Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
-**Stores**: `pkg/store` (InMemory) and `pkg/store/k8s` (controller-runtime client), both behind the same `store.Store` interface and exercised by the same `pkg/store/storetest` shared suite — behavioural drift fails the same subtest immediately.
29
-
-**Tests**: 150+ unit + contract; controller-runtime envtest harness skips cleanly when `KUBEBUILDER_ASSETS` is missing, so plain `go test ./...` is green without `make setup-envtest`.
30
-
-**Lint**: `golangci-lint run ./...` zero issues. Auto-lint hook (`golangci-lint@claude-code-companions`) catches every Go-file edit.
18
+
-**Phase**: 2 — definition side done, reconcilers + autoplacer next.
-**Tests**: 200+ unit + contract; envtest harness skips cleanly when
35
+
`KUBEBUILDER_ASSETS` is missing.
36
+
-**Lint**: `golangci-lint run ./...` zero issues. Auto-lint hook on every
37
+
Go-file edit.
31
38
-**Blocker**: none.
32
-
-**Next concrete steps**:
33
-
1.`/v1/resource-definitions/{rd}/volume-definitions` (CRUD) — needed before linstor-csi can size a PVC.
34
-
2.`/v1/resource-groups/{rg}/spawn` — the CSI provisioner calls this on every `CreateVolume`. Needs an `Autoplacer` stub: read RG select-filter, pick `place_count` storage pools, create matching `Resource`s.
35
-
3.`/v1/key-value-store` — linstor-csi keeps its own per-volume bookkeeping here.
0 commit comments