Skip to content

Commit

Permalink
fix: allow empty list for CNI URLs
Browse files Browse the repository at this point in the history
This PR fixes a bug where, only when init nodes were used, we were
throwing an error during validation if there were no URLs in the list
for custom CNIs. We actually allow this empty list now so folks can
BYO-CNI.

Signed-off-by: Spencer Smith <robertspencersmith@gmail.com>
  • Loading branch information
rsmitty authored and talos-bot committed Mar 24, 2021
1 parent 946e74f commit 5ff491d
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions pkg/machinery/config/types/v1alpha1/v1alpha1_validation.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,8 @@ func (c *Config) Validate(mode config.RuntimeMode, options ...config.ValidationO

if c.Machine().Type() == machine.TypeInit {
switch c.Cluster().Network().CNI().Name() {
case "custom":
if len(c.Cluster().Network().CNI().URLs()) == 0 {
result = multierror.Append(result, errors.New("at least one url should be specified if using \"custom\" option for CNI"))
}
case constants.CustomCNI:
// custom CNI with URLs or an empty list of manifests which will get applied
case constants.DefaultCNI:
// it's flannel bby
default:
Expand Down

0 comments on commit 5ff491d

Please sign in to comment.