From e1193261847274f293cb524fc2ceb5f864f5b66e Mon Sep 17 00:00:00 2001 From: iwilltry42 Date: Wed, 3 Feb 2021 12:36:04 +0100 Subject: [PATCH] fix: --no-lb failed - initialize port map of initnode, if nil Fixes #463 --- pkg/client/cluster.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/client/cluster.go b/pkg/client/cluster.go index 00535170..fa33cc95 100644 --- a/pkg/client/cluster.go +++ b/pkg/client/cluster.go @@ -436,6 +436,9 @@ ClusterCreatOpts: // in case the LoadBalancer was disabled, expose the API Port on the initializing server node if clusterCreateOpts.DisableLoadBalancer { + if cluster.InitNode.Ports == nil { + cluster.InitNode.Ports = nat.PortMap{} + } cluster.InitNode.Ports[k3d.DefaultAPIPort] = []nat.PortBinding{cluster.KubeAPI.Binding} }