From d20b26d2ed9cbaabcb610825f085caeef8b92887 Mon Sep 17 00:00:00 2001 From: Alexey Artamonov Date: Sun, 8 Nov 2026 20:34:28 +0300 Subject: [PATCH] test(clickhouse): pin that a refused Secret delete fails the round-trip restore The owned Ingress Secret's delete only became reachable once its lookup stopped asking for a name and a selector together, and nothing failed the stub's delete, so dropping the delete's status from the restore's result passed every test. The CoreDNS half of the restore already has this guarantee pinned. Assisted-by: LLM Signed-off-by: Alexey Artamonov --- hack/clickhouse-system-bucket-shared-state.bats | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/hack/clickhouse-system-bucket-shared-state.bats b/hack/clickhouse-system-bucket-shared-state.bats index 574eba84f..d09fa0260 100644 --- a/hack/clickhouse-system-bucket-shared-state.bats +++ b/hack/clickhouse-system-bucket-shared-state.bats @@ -55,7 +55,12 @@ case "$*" in [ "$selector" = cozystack.io/e2e-owner=clickhouse-system-bucket ] || exit 0 for s in ${OWNED_SECRETS:-}; do echo "secret/$s"; done ;; - *"delete secret "*) ;; + *"delete secret "*) + if [ -n "${DELETE_FAILS:-}" ]; then + echo 'Error from server (Forbidden): secrets "seaweedfs-s3-ingress-tls" is forbidden' >&2 + exit 1 + fi + ;; *) echo "unexpected kubectl $*" >&2; exit 2 ;; esac EOF @@ -121,6 +126,15 @@ restore() { done } +@test "a Secret delete the API server refuses fails the restore" { + err=$(mktemp) + if OWNED_SECRETS=seaweedfs-s3-ingress-tls DELETE_FAILS=1 restore 2>"$err"; then + echo "restore_shared_state returned 0 although kubectl delete secret was refused" >&2 + cat "$err" >&2 + false + fi +} + @test "a Secret lookup that fails fails the restore" { err=$(mktemp) if LOOKUP_FAILS=1 restore 2>"$err"; then