From 194201d643c7d530fb83aecc705ace9c5ee7191a Mon Sep 17 00:00:00 2001 From: Andrei Kvapil Date: Mon, 16 Nov 2026 12:33:14 -0500 Subject: [PATCH] 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 --- packages/system/linstor/tests/apiserver_tls_test.yaml | 8 ++++++-- packages/system/linstor/tests/backend_test.yaml | 4 +++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/packages/system/linstor/tests/apiserver_tls_test.yaml b/packages/system/linstor/tests/apiserver_tls_test.yaml index 5e4fb7adb..734608e35 100644 --- a/packages/system/linstor/tests/apiserver_tls_test.yaml +++ b/packages/system/linstor/tests/apiserver_tls_test.yaml @@ -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 diff --git a/packages/system/linstor/tests/backend_test.yaml b/packages/system/linstor/tests/backend_test.yaml index 0b70e69f3..b535edd81 100644 --- a/packages/system/linstor/tests/backend_test.yaml +++ b/packages/system/linstor/tests/backend_test.yaml @@ -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