fix(init_knoe_users): replace multiline die with err+exit to fix pipe syntax error

The 'die' call with a multiline string containing '|' (for base64 pipeline
in the help text) was parsed by bash as a pipe operator. Replace with
individual err() calls followed by explicit exit 1.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
chrisfu 2026-05-09 12:33:58 -07:00
parent 991c04d936
commit 385f74b4f7

View File

@ -291,19 +291,18 @@ initialize() {
log "Using PROLE_LOCAL_ADMIN_PASSWORD as PROLE_KDC_MASTER_PASSWORD" log "Using PROLE_LOCAL_ADMIN_PASSWORD as PROLE_KDC_MASTER_PASSWORD"
fi fi
if [[ -z "$PROLE_KDC_MASTER_PASSWORD" ]]; then if [[ -z "$PROLE_KDC_MASTER_PASSWORD" ]]; then
die "PROLE_KDC_MASTER_PASSWORD not found. err "PROLE_KDC_MASTER_PASSWORD not found."
The KDC master password must match the running KDC database and cannot be auto-generated. err "The KDC master password must match the running KDC database and cannot be auto-generated."
Resolve one of: err "Resolve one of:"
1. Store in k8s secret: err " 1. Store in k8s secret:"
kubectl -n ${KNOE_KDC_NAMESPACE} patch secret knoe-kdc-secrets \\ err " kubectl -n ${KNOE_KDC_NAMESPACE} patch secret knoe-kdc-secrets \\"
--type=merge -p '{\"data\":{\"master_password\":\"'\\$(echo -n <pw> | base64)'\"}}' err " --type=merge -p '{\"data\":{\"master_password\":\"BASE64PW\"}}'"
2. Store in 1Password and set in conf/k3s.cfg: err " 2. Store in 1Password and set in conf/k3s.cfg:"
OP_KDC_MASTER_PASSWORD_REF = op://personal/<item>/password err " OP_KDC_MASTER_PASSWORD_REF = op://personal/<item>/password"
then: op run -- bash etc/init_knoe_users.sh --mode k3s initialize err " then: op run -- bash etc/init_knoe_users.sh --mode k3s initialize"
3. Export directly (not recommended for production): err " 3. Export directly: export PROLE_KDC_MASTER_PASSWORD=<password>"
export PROLE_KDC_MASTER_PASSWORD=<password> err " 4. Check existing: kubectl -n ${KNOE_KDC_NAMESPACE} get secrets"
4. Check existing secrets: exit 1
kubectl -n ${KNOE_KDC_NAMESPACE} get secrets | grep kdc"
fi fi
if [[ -z "$KNOE_GUEST_PASSWORD" ]]; then if [[ -z "$KNOE_GUEST_PASSWORD" ]]; then