Skip to content

Commit

Permalink
add simple log dump
Browse files Browse the repository at this point in the history
  • Loading branch information
pmacius committed Aug 6, 2024
1 parent f6ed889 commit acc0d63
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -198,14 +198,21 @@ jobs:
kubectl get all --all-namespaces
kubectl describe pod
- name: Dump Kubernetes Logs
uses: dashanji/kubernetes-log-export-action@v6
with:
output_dir: ./output
- name: Collect logs from all containers
if: always() && steps.helm_install.outcome != 'skipped'
run: |
mkdir -p logs
for pod in $(kubectl get pods --all-namespaces -o jsonpath='{.items[*].metadata.name}'); do
namespace=$(kubectl get pod $pod --all-namespaces -o jsonpath='{.items[*].metadata.namespace}')
kubectl logs $pod -n $namespace > logs/${namespace}_${pod}.log
done
- name: Run Stoat Action
uses: stoat-dev/stoat-action@v0
if: always()
- name: Upload logs as artifact
if: always() && steps.helm_install.outcome != 'skipped'
uses: actions/upload-artifact@v3
with:
name: k8s-logs
path: logs

- name: Run helm test
id: helm_test
Expand Down

0 comments on commit acc0d63

Please sign in to comment.