Skip to content

Commit 21b062c

Browse files
Allow less than three NTP servers (#607)
1 parent 96729c0 commit 21b062c

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

cmd/metal-api/internal/metal/machine.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@ import (
1414

1515
"github.com/asaskevich/govalidator"
1616
"github.com/dustin/go-humanize"
17-
mn "github.com/metal-stack/metal-lib/pkg/net"
1817
"github.com/samber/lo"
18+
19+
mn "github.com/metal-stack/metal-lib/pkg/net"
1920
)
2021

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

761-
if len(n) < 3 || len(n) > 5 {
762-
return errors.New("please specify a minimum of 3 and a maximum of 5 ntp servers")
762+
if len(n) > 5 {
763+
return errors.New("please specify a maximum of five ntp servers")
763764
}
764765

765766
for _, ntpserver := range n {

0 commit comments

Comments
 (0)