Skip to content

Commit

Permalink
validate podSubnet
Browse files Browse the repository at this point in the history
  • Loading branch information
BenTheElder committed May 14, 2019
1 parent 34a5823 commit 13de3fc
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pkg/cluster/config/validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ limitations under the License.
package config

import (
"net"

"github.com/pkg/errors"

"sigs.k8s.io/kind/pkg/util"
Expand Down Expand Up @@ -48,6 +50,11 @@ func (c *Cluster) Validate() error {
errs = append(errs, errors.Errorf("must have at least one %s node", string(ControlPlaneRole)))
}

// podSubnet should be a valid CIDR
if _, _, err := net.ParseCIDR(c.Networking.PodSubnet); err != nil {
errs = append(errs, errors.Wrapf(err, "invalid podSubnet"))
}

if len(errs) > 0 {
return util.NewErrors(errs)
}
Expand Down

0 comments on commit 13de3fc

Please sign in to comment.