Skip to content

Commit 1fcb67b

Browse files
committed
fix(scripts): tolerate missing /proc inotify path on non-Linux hosts
The PROM_ENABLED pre-flight check reads /proc/sys/fs/inotify/max_user_instances, which only exists on Linux. On macOS the failed read aborts make env-dev-kind under set -eo pipefail before the cluster is created. Fall back to a passing value when the path is absent so the check degrades gracefully off-Linux; behavior on Linux is unchanged. Signed-off-by: Alok Behera <alokbeherak061@gmail.com>
1 parent 3b9d93b commit 1fcb67b

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

scripts/kind-dev-env.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,10 @@ done
200200

201201
# Prometheus config-reloader needs sufficient inotify resources
202202
if [ "${PROM_ENABLED}" == "true" ]; then
203-
INOTIFY_INSTANCES=$(cat /proc/sys/fs/inotify/max_user_instances)
203+
# On non-Linux hosts (e.g. macOS) /proc does not exist and the kind pods run in
204+
# the container-runtime VM, not the host, so fall back to a passing value rather
205+
# than letting the failed read abort the script under `set -e`.
206+
INOTIFY_INSTANCES=$(cat /proc/sys/fs/inotify/max_user_instances 2>/dev/null || echo 512)
204207
if [ "${INOTIFY_INSTANCES}" -lt 512 ]; then
205208
echo "Error: fs.inotify.max_user_instances is ${INOTIFY_INSTANCES} (need >= 512) for Prometheus."
206209
echo ""

0 commit comments

Comments
 (0)