Inline supportsPrivateTopology

This commit is contained in:
Ole Markus With 2020-05-22 07:48:47 +02:00
parent 82c4670f04
commit e3055a6906
1 changed files with 1 additions and 5 deletions

View File

@ -1108,7 +1108,7 @@ func RunCreateCluster(ctx context.Context, f *util.Factory, out io.Writer, c *Cr
}
case api.TopologyPrivate:
if !supportsPrivateTopology(cluster.Spec.Networking) {
if cluster.Spec.Networking.Kubenet != nil {
return fmt.Errorf("invalid networking option %s. Kubenet does not support private topology", c.Networking)
}
cluster.Spec.Topology = &api.TopologySpec{
@ -1451,10 +1451,6 @@ func RunCreateCluster(ctx context.Context, f *util.Factory, out io.Writer, c *Cr
return nil
}
func supportsPrivateTopology(n *api.NetworkingSpec) bool {
return n.Kubenet == nil
}
func trimCommonPrefix(names []string) []string {
// Trim shared prefix to keep the lengths sane
// (this only applies to new clusters...)