fix: init portmap if nil in all cases (#463)

pull/324/head
iwilltry42 4 years ago
parent eaee32e227
commit 0c7db203d0
No known key found for this signature in database
GPG Key ID: 7BA57AD1CFF16110
  1. 3
      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}
}

Loading…
Cancel
Save