Skip to content

Commit

Permalink
Allow less than three NTP servers (#607)
Browse files Browse the repository at this point in the history
  • Loading branch information
robertvolkmann authored Feb 12, 2025
1 parent 96729c0 commit 21b062c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions cmd/metal-api/internal/metal/machine.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@ import (

"github.com/asaskevich/govalidator"
"github.com/dustin/go-humanize"
mn "github.com/metal-stack/metal-lib/pkg/net"
"github.com/samber/lo"

mn "github.com/metal-stack/metal-lib/pkg/net"
)

// A MState is an enum which indicates the state of a machine
Expand Down Expand Up @@ -758,8 +759,8 @@ func (n NTPServers) Validate() error {
return nil
}

if len(n) < 3 || len(n) > 5 {
return errors.New("please specify a minimum of 3 and a maximum of 5 ntp servers")
if len(n) > 5 {
return errors.New("please specify a maximum of five ntp servers")
}

for _, ntpserver := range n {
Expand Down

0 comments on commit 21b062c

Please sign in to comment.