Skip to content

Commit 9a77f6c

Browse files
committed
ingress: ensure dstack.sock is a UDS before using it
1 parent 1a43a9c commit 9a77f6c

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

custom-domain/dstack-ingress/scripts/entrypoint.sh

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,7 @@
33
set -e
44

55
PORT=${PORT:-443}
6-
if [[ -e /var/run/dstack.sock ]]; then
7-
TXT_PREFIX=${TXT_PREFIX:-"_dstack-app-address"}
8-
else
9-
TXT_PREFIX=${TXT_PREFIX:-"_tapp-address"}
10-
fi
6+
TXT_PREFIX=${TXT_PREFIX:-"_dstack-app-address"}
117
PROXY_CMD="proxy"
128
if [[ "${TARGET_ENDPOINT}" == grpc://* ]]; then
139
PROXY_CMD="grpc"
@@ -127,7 +123,7 @@ set_txt_record() {
127123
local domain="$1"
128124
local APP_ID
129125

130-
if [[ -e /var/run/dstack.sock ]]; then
126+
if [[ -S /var/run/dstack.sock ]]; then
131127
DSTACK_APP_ID=$(curl -s --unix-socket /var/run/dstack.sock http://localhost/Info | jq -j .app_id)
132128
export DSTACK_APP_ID
133129
else

custom-domain/dstack-ingress/scripts/generate-evidences.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ while [ ${#PADDED_HASH} -lt 128 ]; do
4040
done
4141
QUOTED_HASH="${PADDED_HASH}"
4242

43-
if [[ -e /var/run/dstack.sock ]]; then
43+
if [[ -S /var/run/dstack.sock ]]; then
4444
curl -s --unix-socket /var/run/dstack.sock "http://localhost/GetQuote?report_data=${QUOTED_HASH}" > quote.json
4545
else
4646
curl -s --unix-socket /var/run/tappd.sock "http://localhost/prpc/Tappd.RawQuote?report_data=${QUOTED_HASH}" > quote.json

0 commit comments

Comments
 (0)