Skip to content

Commit

Permalink
Add validation of machine pool size to config
Browse files Browse the repository at this point in the history
  • Loading branch information
kthomas committed Feb 6, 2024
1 parent 2cb918a commit 6734e5e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions internal/node/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ type NodeConfiguration struct {
func (c *NodeConfiguration) Validate() bool {
c.Errors = make([]error, 0)

if c.MachinePoolSize < 1 {
c.Errors = append(c.Errors, errors.New("machine pool size must be >= 1"))
}

if _, err := os.Stat(c.KernelFilepath); errors.Is(err, os.ErrNotExist) {
c.Errors = append(c.Errors, err)
}
Expand Down Expand Up @@ -157,3 +161,4 @@ func LoadNodeConfiguration(configFilepath string) (*NodeConfiguration, error) {

return &config, nil
}

0 comments on commit 6734e5e

Please sign in to comment.