8000 🧪 Preserve safe E2E diagnostics by abahmed · Pull Request #517 · abahmed/kwatch · GitHub
[go: up one dir, main page]

Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 18 additions & 3 deletions scripts/test-kind-scenarios.sh
Original file line number Diff line number Diff line change
Expand Up @@ -119,12 +119,27 @@ EOF
kind export logs "$ARTIFACTS/kind-logs" \
--name "$KIND_CLUSTER_NAME" >/dev/null 2>&1 || true
if ! "$harness_root/scripts/check-e2e-artifacts.sh" "$ARTIFACTS"; then
find "$ARTIFACTS" -type f -exec rm -f {} +
printf '%s\n' 'artifact safety check failed' \
>"$ARTIFACTS/artifact-safety-failed.txt"
quarantine_unsafe_artifacts
fi
}

quarantine_unsafe_artifacts() {
quarantine_log="$ARTIFACTS/artifact-safety-quarantine.txt"
printf '%s\n' \
'artifact safety check found one or more unsafe files' \
>"$quarantine_log"
while IFS= read -r artifact; do
if ! "$harness_root/scripts/check-e2e-artifacts.sh" "$artifact";
then
printf 'removed=%s\n' "${artifact#"$ARTIFACTS"/}" \
>>"$quarantine_log"
rm -f "$artifact"
fi
done <<EOF
$(find "$ARTIFACTS" -type f ! -name 'artifact-safety-quarantine.txt')
EOF
}

capture_http_diagnostics() {
mkdir -p "$ARTIFACTS/kwatch" "$ARTIFACTS/receiver"
receiver_pod=$(kubectl -n kwatch-e2e-system get pods \
Expand Down
Loading
0