Skip to content

Commit

Permalink
Merge pull request #4278 from mikesplain/validate_min_max
Browse files Browse the repository at this point in the history
Validate IG MaxSize is not less than MinSize.
k8s-ci-robot authored Jan 19, 2018
2 parents 6752175 + 3dfc8a3 commit b2c1e2a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pkg/apis/kops/validation/instancegroup.go
Original file line number Diff line number Diff line change
@@ -39,6 +39,12 @@ func ValidateInstanceGroup(g *kops.InstanceGroup) error {
}
}

if g.Spec.MaxSize != nil && g.Spec.MinSize != nil {
if *g.Spec.MaxSize < *g.Spec.MinSize {
return field.Invalid(field.NewPath("MaxSize"), *g.Spec.MaxSize, "maxSize must be greater than or equal to minSize.")
}
}

switch g.Spec.Role {
case kops.InstanceGroupRoleMaster:
case kops.InstanceGroupRoleNode:

0 comments on commit b2c1e2a

Please sign in to comment.