Skip to content

Commit

Permalink
use simpler for loop
Browse files Browse the repository at this point in the history
  • Loading branch information
miampf committed Aug 28, 2024
1 parent 0296b8d commit cedf045
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/scripts.nix
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@
while kubectl get ns "$namespace" 1>/dev/null 2>/dev/null; do
pods="$(kubectl get pods -n "$namespace" | awk '!/^NAME/{print $1}')"
mkdir -p "workspace/namespace-logs"
while IFS= read -r pod; do
for pod in $pods; do
logfile="workspace/namespace-logs/$pod.log"
if ! [[ -f "$logfile" ]]; then
{
Expand All @@ -342,7 +342,7 @@
kubectl logs -f --all-containers=true -n "$namespace" "$pod" > "$logfile"
} &
fi
done <<< "$pods"
done
done
wait
'';
Expand Down

0 comments on commit cedf045

Please sign in to comment.