Skip to content

Commit c22e1ca

Browse files
authored
Remove useless stacktrace when returning an error during reconcile. (#46)
1 parent c02c0ec commit c22e1ca

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

cmd/main.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import (
2424

2525
// Import all Kubernetes client auth plugins (e.g. Azure, GCP, OIDC, etc.)
2626
// to ensure that exec-entrypoint and run can make use of them.
27+
"go.uber.org/zap/zapcore"
2728
_ "k8s.io/client-go/plugin/pkg/client/auth"
2829

2930
"k8s.io/apimachinery/pkg/runtime"
@@ -75,7 +76,8 @@ func main() {
7576
flag.BoolVar(&enableHTTP2, "enable-http2", false,
7677
"If set, HTTP/2 will be enabled for the metrics and webhook servers")
7778
opts := zap.Options{
78-
Development: true,
79+
Development: true,
80+
StacktraceLevel: zapcore.DPanicLevel,
7981
}
8082
opts.BindFlags(flag.CommandLine)
8183
flag.Parse()

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ require (
99
github.com/onsi/ginkgo/v2 v2.22.0
1010
github.com/onsi/gomega v1.36.0
1111
github.com/stretchr/testify v1.9.0
12+
go.uber.org/zap v1.27.0
1213
golang.org/x/sync v0.10.0
1314
k8s.io/api v0.31.3
1415
k8s.io/apimachinery v0.31.3
@@ -102,7 +103,6 @@ require (
102103
go.opentelemetry.io/otel/trace v1.29.0 // indirect
103104
go.opentelemetry.io/proto/otlp v1.3.1 // indirect
104105
go.uber.org/multierr v1.11.0 // indirect
105-
go.uber.org/zap v1.27.0 // indirect
106106
golang.org/x/crypto v0.31.0 // indirect
107107
golang.org/x/exp v0.0.0-20241009180824-f66d83c29e7c // indirect
108108
golang.org/x/net v0.33.0 // indirect

0 commit comments

Comments
 (0)