fix(check_kerberos): default PROLE_KDC_NAME to authority-knoe-auth (matches init_kdc.sh)

check_kerberos.sh defaulted PROLE_KDC_NAME=auth but init_kdc.sh deploys the
pod with label app=authority-knoe-auth (authority-gcp-auth for k8s). The pod
selector never matched, so wait_for_kdc_pod always returned empty and the test
failed with "KDC pod 'auth' not found" even after a successful rollout.

Add _default_kdc_name() using the same mode-aware logic as init_kdc.sh.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
chrisfu 2026-05-03 15:23:40 -07:00
parent d110f594c6
commit 96964b0a2b

View File

@ -59,7 +59,15 @@ KRB5_REALM=${KRB5_REALM:-${REALM:-}}
KRB5_KDC=${KRB5_KDC:-}
KRB5_USER=${KRB5_USER:-${KRB5_USERNAME:-}}
KRB5_PASSWORD=${KRB5_PASSWORD:-}
PROLE_KDC_NAME=${PROLE_KDC_NAME:-auth}
_default_kdc_name() {
local _mode
_mode=$(knoe_normalize_mode "${KNOE_MODE:-${DEPLOYMENT_MODE:-${CLUSTER_ENV:-}}}" 2>/dev/null || printf '%s' "${KNOE_MODE:-}")
case "$_mode" in
k8s) printf 'authority-gcp-auth' ;;
*) printf 'authority-knoe-auth' ;;
esac
}
PROLE_KDC_NAME=${PROLE_KDC_NAME:-$(_default_kdc_name)}
PROLE_KDC_SERVICE=${PROLE_KDC_SERVICE:-auth}
SAMBA_ADMIN_USER=${SAMBA_ADMIN_USER:-}
SAMBA_ADMIN_PASSWORD=${SAMBA_ADMIN_PASSWORD:-}