test(linstor): select TLS documents by name, not by position

Both templates render several cert-manager objects, so a positional
index silently retargets an assertion whenever a document is added or
reordered above it. main now rejects new documentIndex selectors on
multi-document templates for exactly that reason.

Assisted-by: LLM
Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
This commit is contained in:
Andrei Kvapil committed 2026-11-29 13:45:12 +01:00
1 parent 26435fc0fd
commit 194201d643
2 files changed
+9 -3

No files matched your search

@@ -22,7 +22,9 @@ set:
tests:
- it: "issues the client certificate the operator is pointed at, from the blockstor CA"
template: templates/blockstor-apiserver-tls.yaml
documentIndex: 3
documentSelector:
path: metadata.name
value: blockstor-apiserver-client
asserts:
- isKind:
of: Certificate
@@ -46,7 +48,9 @@ tests:
- it: "serves from the same CA the client certificate validates against"
template: templates/blockstor-apiserver-tls.yaml
documentIndex: 2
documentSelector:
path: metadata.name
value: blockstor-apiserver-server
asserts:
- isKind:
of: Certificate
@@ -68,9 +68,11 @@ tests:
- hasDocuments:
count: 2
- equal:
path: spec.ca.secretName
value: linstor-internal-ca
documentSelector:
path: kind
value: Issuer
documentIndex: 1
# The plunger runs drbdadm against the node's DRBD resources on its own
# schedule. Under blockstor those belong to blockstor-satellite alone, so the