#!/usr/bin/env bash # Vault helper functions. Depends on lib/common.sh being sourced first. # # Environment contract: # VAULT_NAMESPACE — k8s namespace where vault-0 runs (default: mnt) # VAULT_POD — Vault pod name (default: vault-0) # VAULT_KEYS_FILE — path to JSON file produced by vault operator init # (default: $REPO_ROOT/vault-init-keys.json) # shellcheck shell=bash # shellcheck source=./common.sh # (common.sh must be sourced by the caller.) : "${VAULT_NAMESPACE:=mnt}" : "${VAULT_POD:=vault-0}" # vault_exec — exec vault CLI inside the Vault pod. # -i 를 붙여서 호출자의 stdin 을 컨테이너로 파이프 (vault login -no-print - 등). vault_exec() { kubectl exec -i -n "$VAULT_NAMESPACE" "$VAULT_POD" -- vault "$@" } # vault_exec_sh