Skip to content

Commit e0ec1f9

Browse files
committed
print-api7-ingress-system-logs
1 parent 3834052 commit e0ec1f9

File tree

3 files changed

+3
-38
lines changed

3 files changed

+3
-38
lines changed

.github/workflows/e2e-test.yml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -83,13 +83,3 @@ jobs:
8383
TSET_ENV: CI
8484
run: |
8585
make e2e-test
86-
87-
- name: Pint Ingress Controller Logs
88-
if: failure()
89-
run: |
90-
ls *.log
91-
for log_file in $(find . -type f -name "*.log"); do
92-
echo "\n================= $log_file =======================>>"
93-
cat "$log_file"
94-
echo "<<================= $log_file =======================\n"
95-
done

Makefile

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

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

test/e2e/scaffold/scaffold.go

Lines changed: 3 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,10 @@
1616
package scaffold
1717

1818
import (
19-
"bytes"
2019
"context"
2120
"crypto/tls"
2221
"crypto/x509"
2322
"fmt"
24-
"io"
2523
"net"
2624
"net/http"
2725
"net/url"
@@ -36,7 +34,6 @@ import (
3634
"github.com/gruntwork-io/terratest/modules/testing"
3735
. "github.com/onsi/ginkgo/v2"
3836
. "github.com/onsi/gomega"
39-
"github.com/stretchr/testify/require"
4037
corev1 "k8s.io/api/core/v1"
4138
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
4239
"k8s.io/apimachinery/pkg/util/wait"
@@ -453,31 +450,13 @@ func (s *Scaffold) DeployTestService() {
453450
func (s *Scaffold) afterEach() {
454451
defer GinkgoRecover()
455452
s.DeleteGatewayGroup(s.gatewaygroupid)
456-
_, _ = fmt.Fprintf(GinkgoWriter, "s.namespace: %s\n", s.namespace)
457-
_, _ = fmt.Fprintf(GinkgoWriter, "s.kubectlOptions: %+v\n", s.kubectlOptions)
458453

459454
if CurrentSpecReport().Failed() {
460455
if os.Getenv("TSET_ENV") == "CI" {
461-
var buf = bytes.NewBuffer(nil)
462456
_, _ = fmt.Fprintln(GinkgoWriter, "Dumping namespace contents")
463-
output, _ := k8s.RunKubectlAndGetOutputE(GinkgoT(), s.kubectlOptions, "get", "deploy,sts,svc,pods")
464-
if output != "" {
465-
_, _ = fmt.Fprintln(io.MultiWriter(GinkgoWriter, buf), output)
466-
}
467-
output, _ = k8s.RunKubectlAndGetOutputE(GinkgoT(), s.kubectlOptions, "describe", "pods")
468-
if output != "" {
469-
_, _ = buf.WriteString("/n")
470-
_, _ = fmt.Fprintln(io.MultiWriter(GinkgoWriter, buf), output)
471-
}
472-
output, _ = k8s.RunKubectlAndGetOutputE(GinkgoT(), s.kubectlOptions, "logs", "-l",
473-
"control-plane=controller-manager")
474-
if output != "" {
475-
_, _ = buf.WriteString("/n")
476-
_, _ = buf.WriteString("controller-manager log\n")
477-
_, _ = buf.WriteString(output)
478-
_, _ = buf.WriteString("/n")
479-
require.NoError(GinkgoT(), os.WriteFile("../../"+s.namespace+"-controller-manager.log", buf.Bytes(), 0644))
480-
}
457+
_, _ = k8s.RunKubectlAndGetOutputE(GinkgoT(), s.kubectlOptions, "get", "deploy,sts,svc,pods")
458+
_, _ = k8s.RunKubectlAndGetOutputE(GinkgoT(), s.kubectlOptions, "describe", "pods")
459+
_, _ = k8s.RunKubectlAndGetOutputE(GinkgoT(), s.kubectlOptions, "logs", "-l", "control-plane=controller-manager")
481460
}
482461
}
483462

0 commit comments

Comments
 (0)