diff --git a/cmd/e2e.sh b/cmd/e2e.sh index 1251d3d..f5bb396 100755 --- a/cmd/e2e.sh +++ b/cmd/e2e.sh @@ -269,9 +269,14 @@ EOF audit_container > $DATADIR/repo_audit if [ ! -z "$LOCAL_KUBECONFIG" ]; then - echo "Running Collection" - verify_env - collect_data + if [ -z "$( find $OUTPUTDIR/* -prune -type f 2>/dev/null )" ]; then + echo "Running Collection" + verify_env + collect_data + else + echo "Cannot run data collection when $OUTPUTDIR contains files." + exit 1 + fi else echo "Skipping data collection" fi