query namespaced K8s API in logical backup script (#623)

This commit is contained in:
Felix Kunde
2019-07-18 14:00:30 +02:00
committed by GitHub
parent 53fea88391
commit 2c3c7fd244
2 changed files with 12 additions and 3 deletions
+3 -3
View File
@@ -48,14 +48,14 @@ function aws_upload {
function get_pods {
declare -r SELECTOR="$1"
curl "${K8S_API_URL}/pods?$SELECTOR" \
curl "${K8S_API_URL}/namespaces/${POD_NAMESPACE}/pods?$SELECTOR" \
--cacert $CERT \
-H "Authorization: Bearer ${TOKEN}" | jq .items[].status.podIP -r
}
function get_current_pod {
curl "${K8S_API_URL}/pods?fieldSelector=metadata.name%3D${HOSTNAME}" \
--cacert $CERT \
curl "${K8S_API_URL}/namespaces/${POD_NAMESPACE}/pods?fieldSelector=metadata.name%3D${HOSTNAME}" \
--cacert $CERT \
-H "Authorization: Bearer ${TOKEN}"
}