Skip to content

Commit

Permalink
[FIX] Prevent segmentation fault with --no-lb and --verbose/trace (#775)
Browse files Browse the repository at this point in the history
  • Loading branch information
benjaminjb authored Oct 8, 2021
1 parent de58056 commit 2040a45
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pkg/client/ports.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,9 @@ func TransformPorts(ctx context.Context, runtime runtimes.Runtime, cluster *k3d.

}

// print generated loadbalancer config
if l.Log().GetLevel() >= logrus.DebugLevel {
// print generated loadbalancer config if exists
// (avoid segmentation fault if loadbalancer is disabled)
if l.Log().GetLevel() >= logrus.DebugLevel && cluster.ServerLoadBalancer != nil {
yamlized, err := yaml.Marshal(cluster.ServerLoadBalancer.Config)
if err != nil {
l.Log().Errorf("error printing loadbalancer config: %v", err)
Expand Down

0 comments on commit 2040a45

Please sign in to comment.