mirror of https://github.com/kubernetes/kops.git
Turn off validation that master & nodes have same topology
First step towards supporting mixed-modes.
This commit is contained in:
parent
17afbd6292
commit
bb46c3ca32
|
@ -310,9 +310,6 @@ func (c *Cluster) Validate(strict bool) error {
|
||||||
return fmt.Errorf("Invalid Masters value for Topology")
|
return fmt.Errorf("Invalid Masters value for Topology")
|
||||||
} else if c.Spec.Topology.Nodes != TopologyPublic && c.Spec.Topology.Nodes != TopologyPrivate {
|
} else if c.Spec.Topology.Nodes != TopologyPublic && c.Spec.Topology.Nodes != TopologyPrivate {
|
||||||
return fmt.Errorf("Invalid Nodes value for Topology")
|
return fmt.Errorf("Invalid Nodes value for Topology")
|
||||||
// Until we support other topologies - these must match
|
|
||||||
} else if c.Spec.Topology.Masters != c.Spec.Topology.Nodes {
|
|
||||||
return fmt.Errorf("Topology Nodes must match Topology Masters")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -322,13 +322,13 @@ func TestPopulateCluster_TopologyInvalidValue_Required(t *testing.T) {
|
||||||
expectErrorFromPopulateCluster(t, c, "Topology")
|
expectErrorFromPopulateCluster(t, c, "Topology")
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestPopulateCluster_TopologyInvalidMatchingValues_Required(t *testing.T) {
|
//func TestPopulateCluster_TopologyInvalidMatchingValues_Required(t *testing.T) {
|
||||||
// We can't have a bastion with public masters / nodes
|
// // We can't have a bastion with public masters / nodes
|
||||||
c := buildMinimalCluster()
|
// c := buildMinimalCluster()
|
||||||
c.Spec.Topology.Masters = api.TopologyPublic
|
// c.Spec.Topology.Masters = api.TopologyPublic
|
||||||
c.Spec.Topology.Nodes = api.TopologyPrivate
|
// c.Spec.Topology.Nodes = api.TopologyPrivate
|
||||||
expectErrorFromPopulateCluster(t, c, "Topology")
|
// expectErrorFromPopulateCluster(t, c, "Topology")
|
||||||
}
|
//}
|
||||||
|
|
||||||
func TestPopulateCluster_BastionInvalidMatchingValues_Required(t *testing.T) {
|
func TestPopulateCluster_BastionInvalidMatchingValues_Required(t *testing.T) {
|
||||||
// We can't have a bastion with public masters / nodes
|
// We can't have a bastion with public masters / nodes
|
||||||
|
|
|
@ -55,18 +55,6 @@ func buildCloudupTags(cluster *api.Cluster) (sets.String, error) {
|
||||||
return nil, fmt.Errorf("No networking mode set")
|
return nil, fmt.Errorf("No networking mode set")
|
||||||
}
|
}
|
||||||
|
|
||||||
// Network Topologies
|
|
||||||
if cluster.Spec.Topology == nil {
|
|
||||||
return nil, fmt.Errorf("missing topology spec")
|
|
||||||
}
|
|
||||||
if cluster.Spec.Topology.Masters == api.TopologyPublic && cluster.Spec.Topology.Nodes == api.TopologyPublic {
|
|
||||||
tags.Insert("_topology_public")
|
|
||||||
} else if cluster.Spec.Topology.Masters == api.TopologyPrivate && cluster.Spec.Topology.Nodes == api.TopologyPrivate {
|
|
||||||
tags.Insert("_topology_private")
|
|
||||||
} else {
|
|
||||||
return nil, fmt.Errorf("Unable to parse topology. Unsupported topology configuration. Masters and nodes must match!")
|
|
||||||
}
|
|
||||||
|
|
||||||
switch cluster.Spec.CloudProvider {
|
switch cluster.Spec.CloudProvider {
|
||||||
case "gce":
|
case "gce":
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue