Skip to content

Commit

Permalink
Merge pull request #965 from DualSpark/patch-panic-validation
Browse files Browse the repository at this point in the history
Adding backwards support for non-topology validation
  • Loading branch information
chrislovecnm authored Nov 21, 2016
2 parents 9e1b3dc + 379a8c8 commit 4308340
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions pkg/apis/kops/validation.go
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,18 @@ func (c *Cluster) Validate(strict bool) error {
}

// Topology support
if c.Spec.Topology == nil {
// This is a case of an older cluster making changes with newer code.. Adding this in for backwards
// compatibility.. Putting this in validation because it can be called from a few places in the code
// base.. all of which make the assumption that the validation should work for their current
// representation of the cluster..
// @kris-nova
// #960
// #943
c.Spec.Topology = &TopologySpec{Masters: TopologyPublic, Nodes: TopologyPublic}
}


if c.Spec.Topology.Masters != "" && c.Spec.Topology.Nodes != "" {
if c.Spec.Topology.Masters != TopologyPublic && c.Spec.Topology.Masters != TopologyPrivate {
return fmt.Errorf("Invalid Masters value for Topology")
Expand Down

0 comments on commit 4308340

Please sign in to comment.