Skip to content

Commit c46e1e9

Browse files
Forostoveceljobe
andauthored
feat(nitro-val): implement ValidationNodeConfig.Validate with logging and persistent checks (#3735)
Co-authored-by: Pepper Lebeck-Jobe <[email protected]>
1 parent d5417e1 commit c46e1e9

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

cmd/nitro-val/config.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package main
22

33
import (
44
"fmt"
5+
"io"
56
"reflect"
67
"time"
78

@@ -145,8 +146,13 @@ func (c *ValidationNodeConfig) GetReloadInterval() time.Duration {
145146
}
146147

147148
func (c *ValidationNodeConfig) Validate() error {
148-
// TODO
149-
return nil
149+
if _, err := genericconf.HandlerFromLogType(c.LogType, io.Discard); err != nil {
150+
return fmt.Errorf("invalid log-type: %w", err)
151+
}
152+
if _, err := genericconf.ToSlogLevel(c.LogLevel); err != nil {
153+
return fmt.Errorf("invalid log-level: %w", err)
154+
}
155+
return c.Persistent.Validate()
150156
}
151157

152158
var DefaultValidationNodeStackConfig = node.Config{

0 commit comments

Comments
 (0)