Skip to content

Commit a859d3b

Browse files
committed
print-api7-ingress-system-logs
1 parent 2f28647 commit a859d3b

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

.github/workflows/e2e-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,4 +86,4 @@ jobs:
8686
- name: Pint Ingress Controller Logs
8787
if: failure()
8888
run: |
89-
make print-api7-ingress-system-logs
89+
cat ingress-controller-logs.log

Makefile

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -264,9 +264,6 @@ gofmt: ## Apply go fmt
264264
@go fmt ./...
265265
.PHONY: gofmt
266266

267-
print-api7-ingress-system-logs:
268-
@kubectl get pods -o=name -n api7-ingress-system | xargs -I{} bash -c "echo ================= {} ==================== && kubectl logs --all-containers -n api7-ingress-system {} && echo ================= {} ===================="
269-
270267
# go-install-tool will 'go install' any package with custom target and name of binary, if it doesn't exist
271268
# $1 - target path with name of binary
272269
# $2 - package url which can be installed

test/e2e/scaffold/scaffold.go

Lines changed: 6 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"
@@ -462,6 +463,11 @@ func (s *Scaffold) afterEach() {
462463
if output != "" {
463464
_, _ = fmt.Fprintln(GinkgoWriter, output)
464465
}
466+
467+
output, _ = k8s.RunKubectlAndGetOutputE(GinkgoT(), s.kubectlOptions, "logs", "--all-containers")
468+
if output != "" {
469+
require.NoError(GinkgoT(), os.WriteFile("../../ingress-controller-logs.log", []byte(output), 0644))
470+
}
465471
}
466472
}
467473

0 commit comments

Comments
 (0)