mirror of
https://github.com/cozystack/cozystack.git
synced 2026-11-21 12:13:55 +09:00
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 <aleksei.artamonov@aenix.io>
This commit is contained in:
1 parent
28f3613450
commit
d20b26d2ed
1 file changed
+15
-1
@@ -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
|
||||
|
||||
Reference in new issue
Block a user