fix(cli): cleanup resolve anchors
Signed-off-by: rjshrjndrn <rjshrjndrn@gmail.com>
This commit is contained in:
parent
03c3dc4d6f
commit
201b74350c
1 changed files with 8 additions and 8 deletions
|
|
@ -328,11 +328,11 @@ function cleanup() {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Run pg cleanup
|
# Run pg cleanup
|
||||||
pguser=$(awk '/postgresqlUser/{print $2}' <"${OR_DIR}/vars.yaml" | xargs)
|
pguser=$(yq 'explode(.) | .global.postgresql.postgresqlUser' ${OR_DIR}/vars.yaml)
|
||||||
pgpassword=$(awk '/postgresqlPassword/{print $2}' <"${OR_DIR}/vars.yaml" | xargs)
|
pgpassword=$(yq 'explode(.) | .global.postgresql.postgresqlPassword' ${OR_DIR}/vars.yaml)
|
||||||
pghost=$(awk '/postgresqlHost/{print $2}' <"${OR_DIR}/vars.yaml" | xargs)
|
pghost=$(yq 'explode(.) | .global.postgresql.postgresqlHost' ${OR_DIR}/vars.yaml)
|
||||||
pgport=$(awk '/postgresqlPort/{print $2}' <"${OR_DIR}/vars.yaml" | xargs)
|
pgport=$(yq 'explode(.) | .global.postgresql.postgresqlPort' ${OR_DIR}/vars.yaml)
|
||||||
pgdatabase=$(awk '/postgresqlDatabase/{print $2}' <"${OR_DIR}/vars.yaml" | xargs)
|
pgdatabase=$(yq 'explode(.) | .global.postgresql.postgresqlDatabase' ${OR_DIR}/vars.yaml)
|
||||||
cleanup_query="DELETE FROM public.sessions WHERE start_ts < extract(epoch from '${delete_from_date}'::date) * 1000;"
|
cleanup_query="DELETE FROM public.sessions WHERE start_ts < extract(epoch from '${delete_from_date}'::date) * 1000;"
|
||||||
[[ $EE ]] && cleanup_query="DELETE FROM public.sessions WHERE start_ts < extract(epoch from '${delete_from_date}'::date) * 1000 AND session_id NOT IN (SELECT session_id FROM user_favorite_sessions);"
|
[[ $EE ]] && cleanup_query="DELETE FROM public.sessions WHERE start_ts < extract(epoch from '${delete_from_date}'::date) * 1000 AND session_id NOT IN (SELECT session_id FROM user_favorite_sessions);"
|
||||||
kubectl delete po -n "${APP_NS}" pg-cleanup &>/dev/null || true
|
kubectl delete po -n "${APP_NS}" pg-cleanup &>/dev/null || true
|
||||||
|
|
@ -345,9 +345,9 @@ function cleanup() {
|
||||||
--env PGPORT="$pgport" \
|
--env PGPORT="$pgport" \
|
||||||
--image bitnami/postgresql -- psql -c "$cleanup_query"
|
--image bitnami/postgresql -- psql -c "$cleanup_query"
|
||||||
# Run minio cleanup
|
# Run minio cleanup
|
||||||
MINIO_ACCESS_KEY=$(awk '/accessKey/{print $NF}' <"${OR_DIR}/vars.yaml" | tail -n1 | xargs)
|
MINIO_ACCESS_KEY=$(yq 'explode(.) | .global.s3.accessKey' ${OR_DIR}/vars.yaml)
|
||||||
MINIO_SECRET_KEY=$(awk '/secretKey/{print $NF}' <"${OR_DIR}/vars.yaml" | tail -n1 | xargs)
|
MINIO_SECRET_KEY=$(yq 'explode(.) | .global.s3.secretKey' ${OR_DIR}/vars.yaml)
|
||||||
MINIO_HOST=$(awk '/endpoint/{print $NF}' <"${OR_DIR}/vars.yaml" | tail -n1 | xargs)
|
MINIO_HOST=$(yq 'explode(.) | .global.minio.host' ${OR_DIR}/vars.yaml)
|
||||||
kubectl delete po -n "${APP_NS}" minio-cleanup &>/dev/null || true
|
kubectl delete po -n "${APP_NS}" minio-cleanup &>/dev/null || true
|
||||||
kubectl run minio-cleanup -n "${APP_NS}" \
|
kubectl run minio-cleanup -n "${APP_NS}" \
|
||||||
--restart=Never \
|
--restart=Never \
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue