From a3b26e6b7069bfd417d164a9e01b965ed66392d4 Mon Sep 17 00:00:00 2001 From: whg517 Date: Thu, 14 May 2026 11:29:20 +0800 Subject: [PATCH] fix(e2e): replace bash-specific [[ with POSIX [ for OSTYPE check Chainsaw executes scripts with /usr/bin/sh (dash on Ubuntu), which does not support [[ or ==. Also add linux-musl (Alpine) variant. --- test/e2e/chainsaw/pod-expires/chainsaw-test.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/e2e/chainsaw/pod-expires/chainsaw-test.yaml b/test/e2e/chainsaw/pod-expires/chainsaw-test.yaml index f4b9b1c..afb733c 100644 --- a/test/e2e/chainsaw/pod-expires/chainsaw-test.yaml +++ b/test/e2e/chainsaw/pod-expires/chainsaw-test.yaml @@ -18,9 +18,9 @@ spec: value: ($namespace) content: | # if os is linux, then use date -d, if os is macos, then use date -v - if [[ "$OSTYPE" == "linux-gnu"* ]]; then + if [ "$OSTYPE" = "linux-gnu" ] || [ "$OSTYPE" = "linux-musl" ]; then NOW_AFTER_5s=$(date -d "+5 seconds" -u +"%Y-%m-%dT%H:%M:%SZ") - elif [[ "$OSTYPE" == "darwin"* ]]; then + elif [ "$OSTYPE" = "darwin" ]; then NOW_AFTER_5s=$(date -v+5S -u +"%Y-%m-%dT%H:%M:%SZ") fi