fix(k01): apply-schema use TCP+PGPASSWORD for CNPG peer-auth bypass
build-and-push-harbor / docker-build-push (push) Waiting to run
build-and-push-harbor / docker-build-push (push) Waiting to run
This commit is contained in:
@@ -17,14 +17,18 @@ domain_dir() {
|
||||
|
||||
psql_exec() {
|
||||
local cluster="$1" sql="$2"
|
||||
kubectl -n juwan exec -i "${cluster}-1" -c postgres -- psql \
|
||||
-v ON_ERROR_STOP=1 -U app -d app <<<"$sql"
|
||||
local pw
|
||||
pw="$(kubectl -n juwan get secret "${cluster}-app" -o jsonpath='{.data.password}' | base64 -d)"
|
||||
kubectl -n juwan exec -i "${cluster}-1" -c postgres -- env PGPASSWORD="$pw" \
|
||||
psql -v ON_ERROR_STOP=1 -h 127.0.0.1 -U app -d app <<<"$sql"
|
||||
}
|
||||
|
||||
psql_file() {
|
||||
local cluster="$1" file="$2"
|
||||
kubectl -n juwan exec -i "${cluster}-1" -c postgres -- psql \
|
||||
-v ON_ERROR_STOP=1 -U app -d app < "$file"
|
||||
local pw
|
||||
pw="$(kubectl -n juwan get secret "${cluster}-app" -o jsonpath='{.data.password}' | base64 -d)"
|
||||
kubectl -n juwan exec -i "${cluster}-1" -c postgres -- env PGPASSWORD="$pw" \
|
||||
psql -v ON_ERROR_STOP=1 -h 127.0.0.1 -U app -d app < "$file"
|
||||
}
|
||||
|
||||
clusters=()
|
||||
|
||||
Reference in New Issue
Block a user