Skip to content

Commit

Permalink
Validate options in main.go
Browse files Browse the repository at this point in the history
Signed-off-by: Connor Catlett <[email protected]>
ConnorJC3 committed Apr 19, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent 88e1b6b commit 0c38366
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion cmd/main.go
Original file line number Diff line number Diff line change
@@ -89,7 +89,12 @@ func main() {
options.AddFlags(fs)

if err = fs.Parse(args); err != nil {
panic(err)
klog.ErrorS(err, "Failed to parse options")
klog.FlushAndExit(klog.ExitFlushTimeout, 0)
}
if err = options.Validate(); err != nil {
klog.ErrorS(err, "Invalid options")
klog.FlushAndExit(klog.ExitFlushTimeout, 0)
}

err = logsapi.ValidateAndApply(c, featureGate)

0 comments on commit 0c38366

Please sign in to comment.