[FIX] Prevent segmentation fault with --no-lb and --verbose/trace (#775)
This commit is contained in:
parent
de5805640b
commit
2040a458b1
@ -100,8 +100,9 @@ func TransformPorts(ctx context.Context, runtime runtimes.Runtime, cluster *k3d.
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// print generated loadbalancer config
|
// print generated loadbalancer config if exists
|
||||||
if l.Log().GetLevel() >= logrus.DebugLevel {
|
// (avoid segmentation fault if loadbalancer is disabled)
|
||||||
|
if l.Log().GetLevel() >= logrus.DebugLevel && cluster.ServerLoadBalancer != nil {
|
||||||
yamlized, err := yaml.Marshal(cluster.ServerLoadBalancer.Config)
|
yamlized, err := yaml.Marshal(cluster.ServerLoadBalancer.Config)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
l.Log().Errorf("error printing loadbalancer config: %v", err)
|
l.Log().Errorf("error printing loadbalancer config: %v", err)
|
||||||
|
Loading…
Reference in New Issue
Block a user