fix(operator): StatefulSet 显式保留世界卷,同名旧世界卷仍在时建服回 409 world_volume_exists,文档写明孤儿卷查找与单节点约束

This commit is contained in:
Lemon-miaow committed 2026-09-25 19:38:13 +08:00
1 parent b7d4275ca9
commit 925cfcf8f8
11 files changed
+112 -22

No files matched your search

+15
View File
@@ -274,6 +274,21 @@ func TestCreateServerRejections(t *testing.T) {
}
},
},
{
// A CR deleted by hand keeps its world volume; a new server of that
// name would mount it and inherit the old world.
name: "world volume left by a deleted server",
body: validCreateBody,
setup: func(_ *fakeRepo, cl *fakeCluster) {
cl.orphanWorld = map[string]bool{"survival": true}
},
wantCode: http.StatusConflict, wantErr: "world_volume_exists",
check: func(t *testing.T, repo *fakeRepo, _ *fakeCluster) {
if repo.seeded["survival"] {
t.Error("a create refused over a leftover volume must not seed a servers row")
}
},
},
}
for _, c := range cases {