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() {
|
psql_exec() {
|
||||||
local cluster="$1" sql="$2"
|
local cluster="$1" sql="$2"
|
||||||
kubectl -n juwan exec -i "${cluster}-1" -c postgres -- psql \
|
local pw
|
||||||
-v ON_ERROR_STOP=1 -U app -d app <<<"$sql"
|
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() {
|
psql_file() {
|
||||||
local cluster="$1" file="$2"
|
local cluster="$1" file="$2"
|
||||||
kubectl -n juwan exec -i "${cluster}-1" -c postgres -- psql \
|
local pw
|
||||||
-v ON_ERROR_STOP=1 -U app -d app < "$file"
|
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=()
|
clusters=()
|
||||||
|
|||||||
Reference in New Issue
Block a user