Skip to content

Commit 3feec9b

Browse files
authored
Merge pull request #248 from nak3/add-required-flag
Add validation for the required flag
2 parents 53ee78d + a248e2a commit 3feec9b

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

cmd/options/options.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,9 @@ func (npdo *NodeProblemDetectorOptions) ValidOrDie() {
8080
panic(fmt.Sprintf("apiserver-override %q is not a valid HTTP URI: %v",
8181
npdo.ApiServerOverride, err))
8282
}
83+
if len(npdo.SystemLogMonitorConfigPaths) == 0 && len(npdo.CustomPluginMonitorConfigPaths) == 0 {
84+
panic(fmt.Sprintf("Either --system-log-monitors or --custom-plugin-monitors is required"))
85+
}
8386
}
8487

8588
// SetNodeNameOrDie sets `NodeName` field with valid value.

0 commit comments

Comments
 (0)