Skip to content

Commit 28da758

Browse files
committed
print-api7-ingress-system-logs
1 parent 0c238ba commit 28da758

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

.github/workflows/e2e-test.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,16 @@ jobs:
8080
shell: bash
8181
env:
8282
API7_EE_LICENSE: ${{ secrets.API7_EE_LICENSE }}
83+
TSET_ENV: CI
8384
run: |
8485
make e2e-test
8586
8687
- name: Pint Ingress Controller Logs
8788
if: failure()
8889
run: |
89-
make print-api7-ingress-system-logs
90+
ls *.log
91+
for log_file in $(find . -type f -name "*.log"); do
92+
echo "================= $log_file =======================>>"
93+
cat "$log_file"
94+
echo "<<================= $log_file ======================="
95+
done

test/e2e/scaffold/scaffold.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ import (
3434
"github.com/gruntwork-io/terratest/modules/testing"
3535
. "github.com/onsi/ginkgo/v2"
3636
. "github.com/onsi/gomega"
37+
"github.com/stretchr/testify/require"
3738
corev1 "k8s.io/api/core/v1"
3839
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
3940
"k8s.io/apimachinery/pkg/util/wait"
@@ -464,6 +465,10 @@ func (s *Scaffold) afterEach() {
464465
if output != "" {
465466
_, _ = fmt.Fprintln(GinkgoWriter, output)
466467
}
468+
output, _ = k8s.RunKubectlAndGetOutputE(GinkgoT(), s.kubectlOptions, "logs", "-l", "control-plane=controller-manager")
469+
if output != "" {
470+
require.NoError(GinkgoT(), os.WriteFile("../../"+s.namespace+"-controller-manager.log", []byte(output), 0644))
471+
}
467472
}
468473
}
469474

0 commit comments

Comments
 (0)