Răsfoiți Sursa

feat(jvb): autoscaler sidecar shutdown hook on finish (#1906)

Aaron van Meerten 7 luni în urmă
părinte
comite
e7cb0f4bca

+ 1 - 1
jvb/rootfs/etc/services.d/jvb/finish

@@ -5,5 +5,5 @@
 # services and shutdown the container.
 
 if [[ $1 -eq 0 ]]; then
-  s6-svscanctl -t /var/run/s6/services
+  /opt/jitsi/shutdown.sh
 fi

+ 7 - 4
jvb/rootfs/opt/jitsi/shutdown.sh

@@ -1,8 +1,11 @@
 #!/usr/bin/with-contenv bash
-# notify the sidecar of imminent shutdown
-PORT=${AUTOSCALER_SIDECAR_PORT:-6000}
-curl -d '{}' -v 0:$PORT/hook/v1/shutdown
-sleep 10
+
+if [ -n "$AUTOSCALER_URL" ]; then
+    # notify the sidecar of imminent shutdown
+    PORT=${AUTOSCALER_SIDECAR_PORT:-6000}
+    curl -d '{}' -v 0:$PORT/hook/v1/shutdown
+    sleep 10
+fi
 
 # shutdown everything
 s6-svscanctl -t /var/run/s6/services