fix(reaper): 只清理备份库的 CronJob 用命名空间默认 SA,e2e 实跑一次 reaper

This commit is contained in:
Lemon-miaow committed 2026-09-27 12:08:03 +08:00
1 parent 572d12d5f3
commit 7b91f7c6c3
4 files changed
+92 -9

No files matched your search

+3
View File
@@ -873,6 +873,9 @@ func TestReaperCronJob_RetentionOnlyShape(t *testing.T) {
if ps.AutomountServiceAccountToken == nil || *ps.AutomountServiceAccountToken {
t.Error("a retention-only run never calls the API and must not mount a service account token")
}
if ps.ServiceAccountName != "default" {
t.Errorf("serviceAccountName = %q, want the namespace default spelled out: felis-reaper renders only with the reaping shape, and an empty name is filled back in from an upgraded install's deprecated serviceAccount", ps.ServiceAccountName)
}
if c.SecurityContext == nil || c.SecurityContext.Capabilities == nil || len(c.SecurityContext.Capabilities.Add) != 1 || c.SecurityContext.Capabilities.Add[0] != "DAC_OVERRIDE" {
t.Error("it reads back and deletes archives other identities wrote, so it keeps DAC_OVERRIDE")
}