diff --git a/apps/authentik/verify-outposts.sh b/apps/authentik/verify-outposts.sh index 1004048..d473ec1 100755 --- a/apps/authentik/verify-outposts.sh +++ b/apps/authentik/verify-outposts.sh @@ -12,9 +12,15 @@ if [ -z "$version" ]; then exit 1 fi -pins=$(kubectl --namespace authentik exec deployment/authentik-worker -- \ +shell_log=$(mktemp) +trap 'rm -f "$shell_log"' EXIT HUP INT TERM +if ! pins=$(kubectl --namespace authentik exec deployment/authentik-worker -- \ ak shell --command \ - 'from authentik.outposts.models import Outpost; [print(f"{o.name}={o.config.container_image}") for o in Outpost.objects.filter(name__in=["ldap", "radius", "rac"]).order_by("name")]') + 'from authentik.outposts.models import Outpost; [print(f"{o.name}={o.config.container_image}") for o in Outpost.objects.filter(name__in=["ldap", "radius", "rac"]).order_by("name")]' \ + 2>"$shell_log"); then + cat "$shell_log" >&2 + exit 1 +fi pin_lines=$(printf '%s\n' "$pins" | grep -E '^(ldap|rac|radius)=' || true) printf '%s\n' "$pin_lines" if [ "$(printf '%s\n' "$pin_lines" | wc -l)" -ne 3 ] || \