Skip to content

Evenfire is an intelligence layer platform for running LLM agents that take real actions, on your infrastructure

TypeScript

fix(e2e): match the structured NetworkPolicy resync timer marker

Jose Gabriel Ramirez Encinas2f012bebac64
diff --git a/scripts/e2e/e2e-wrc-hcc-context-noop-resync.sh b/scripts/e2e/e2e-wrc-hcc-context-noop-resync.sh
index 1694bfbd8..97c608f14 100755
--- a/scripts/e2e/e2e-wrc-hcc-context-noop-resync.sh
+++ b/scripts/e2e/e2e-wrc-hcc-context-noop-resync.sh
@@ -563,8 +563,12 @@ hcc_netpol_timer_arm_epoch() {
pod="$(running_hcc_pod)" || return 1
logs="$(kctl logs "pod/${pod}" -n "$HCC_NS" -c host-context-controller \
--since=10m --timestamps=true 2>/dev/null)" || return 1
- timestamp="$(awk -v marker="NetworkPolicy periodic resync enabled (every ${RESYNC_SECONDS}s)" \
- 'index($0, marker) { value=$1 } END { print value }' <<<"$logs")"
+ # HCC logs this marker as structured JSON with the interval as a field, not
+ # in msg. Match the exact interval so a differently configured timer cannot
+ # satisfy the gate.
+ timestamp="$(awk -v marker='"msg":"[K8s] NetworkPolicy periodic resync enabled"' \
+ -v interval="\"intervalSeconds\":${RESYNC_SECONDS}[,}]" \
+ 'index($0, marker) && $0 ~ interval { value=$1 } END { print value }' <<<"$logs")"
[ -n "$timestamp" ] || return 1
node -e '
const value = Date.parse(process.argv[1]);