fix: --no-lb failed

- initialize port map of initnode, if nil

Fixes #463
pull/476/head
iwilltry42 4 years ago
parent e4aa10e229
commit e119326184
No known key found for this signature in database
GPG Key ID: 7BA57AD1CFF16110
  1. 3
      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}
}

Loading…
Cancel
Save