From 0c7db203d03b38ccb6e6739fda7b6778f8c75a8c Mon Sep 17 00:00:00 2001 From: iwilltry42 Date: Wed, 3 Feb 2021 13:54:11 +0100 Subject: [PATCH] fix: init portmap if nil in all cases (#463) --- pkg/client/cluster.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/client/cluster.go b/pkg/client/cluster.go index fe3f1bd1..4cb6c742 100644 --- a/pkg/client/cluster.go +++ b/pkg/client/cluster.go @@ -458,6 +458,9 @@ ClusterCreatOpts: continue } else if serverCount == 0 && clusterCreateOpts.DisableLoadBalancer { // if this is the first server node and the server loadbalancer is disabled, expose the API Port on this server node + if node.Ports == nil { + node.Ports = nat.PortMap{} + } node.Ports[k3d.DefaultAPIPort] = []nat.PortBinding{cluster.KubeAPI.Binding} }