mirror of
https://github.com/cozystack/cozystack.git
synced 2026-12-01 04:35:40 +09:00
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 <mattia@hidora.io>
(cherry picked from commit 9fba8af69c)
Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
This commit is contained in:
1 parent
32455168e2
commit
5524a41b85
1 file changed
+20
@@ -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
|
||||
|
||||
Reference in new issue
Block a user