Skip to content

Commit

Permalink
fix leader election stack trace
Browse files Browse the repository at this point in the history
fixes #11

Signed-off-by: Markus Blaschke <[email protected]>
  • Loading branch information
mblaschke committed Sep 14, 2024
1 parent 00da062 commit 9b9e742
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions autopilot/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ import (
_ "k8s.io/client-go/plugin/pkg/client/auth"
"k8s.io/client-go/rest"
"k8s.io/client-go/tools/clientcmd"
"sigs.k8s.io/controller-runtime/pkg/log"

"github.com/go-logr/zapr"

"github.com/webdevopos/azure-k8s-autopilot/config"
"github.com/webdevopos/azure-k8s-autopilot/k8s"
Expand Down Expand Up @@ -160,6 +163,8 @@ func (r *AzureK8sAutopilot) initK8s() {
if err != nil {
panic(err.Error())
}

log.SetLogger(zapr.NewLogger(r.Logger.Desugar()))
}

func (r *AzureK8sAutopilot) initMetricsGeneral() {
Expand Down
3 changes: 2 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ require (
github.com/KimMachineGun/automemlimit v0.6.1
github.com/containrrr/shoutrrr v0.8.0
github.com/dustin/go-humanize v1.0.1
github.com/go-logr/zapr v1.3.0
github.com/jessevdk/go-flags v1.6.1
github.com/jinzhu/copier v0.4.0
github.com/operator-framework/operator-lib v0.15.0
Expand All @@ -20,6 +21,7 @@ require (
k8s.io/api v0.31.1
k8s.io/apimachinery v0.31.1
k8s.io/client-go v0.31.1
sigs.k8s.io/controller-runtime v0.19.0
)

require (
Expand Down Expand Up @@ -89,7 +91,6 @@ require (
k8s.io/klog/v2 v2.130.1 // indirect
k8s.io/kube-openapi v0.0.0-20240903163716-9e1beecbcb38 // indirect
k8s.io/utils v0.0.0-20240902221715-702e33fdd3c3 // indirect
sigs.k8s.io/controller-runtime v0.19.0 // indirect
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect
sigs.k8s.io/yaml v1.4.0 // indirect
Expand Down

0 comments on commit 9b9e742

Please sign in to comment.