From 5524a41b8586837edc1d7e6483d6abb677bc0812 Mon Sep 17 00:00:00 2001 From: Mattia Eleuteri Date: Sun, 8 Nov 2026 19:45:18 +0100 Subject: [PATCH] test(redis): pin the release name in the Sentinel PDB hook for the longest release The long-name case checked only that the Job name fits in 63 characters and that the Job targets the right PDB. A Job name that dropped the release, letting two releases' hooks replace each other, or a Role granting a different PDB would both have passed. Assisted-by: LLM Signed-off-by: Mattia Eleuteri (cherry picked from commit 9fba8af69cd2083fbfbeb21e14551f21ad47a73d) Signed-off-by: Myasnikov Daniil --- .../redis/tests/sentinel_pdb_hook_test.yaml | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/packages/apps/redis/tests/sentinel_pdb_hook_test.yaml b/packages/apps/redis/tests/sentinel_pdb_hook_test.yaml index 5676f8d31..03f3da02d 100644 --- a/packages/apps/redis/tests/sentinel_pdb_hook_test.yaml +++ b/packages/apps/redis/tests/sentinel_pdb_hook_test.yaml @@ -116,10 +116,30 @@ tests: - matchRegex: path: metadata.name pattern: '[a-z0-9]$' + # The full release name stays in the Job name, so the hooks of two + # releases in one namespace never replace each other's Job. + - matchRegex: + path: metadata.name + pattern: ^redis-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa- - equal: path: spec.template.spec.containers[0].command[4] value: rfs-redis-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + - it: lets the hook delete the Sentinel PDB of the longest release name + release: + name: redis-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + upgrade: true + set: + replicas: 1 + documentSelector: + path: kind + value: Role + asserts: + - equal: + path: rules[0].resourceNames + value: + - rfs-redis-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + - it: keeps the full Job name for a short release name release: upgrade: true