File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
pkg/customresourcestate/generate Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -46,13 +46,16 @@ var GenerateCommand = &cobra.Command{
46
46
Use : "generate [flags] /path/to/package [/path/to/package]" ,
47
47
Short : "Generate custom resource metrics configuration from go-code markers (experimental)." ,
48
48
DisableFlagsInUseLine : true ,
49
- Args : cobra .MinimumNArgs (1 ),
50
49
RunE : func (cmd * cobra.Command , args []string ) error {
51
50
if generateWhichMarkersFlag {
52
51
PrintMarkerDocs ()
53
52
return nil
54
53
}
55
54
55
+ if len (args ) == 0 {
56
+ return fmt .Errorf ("requires at least 1 arg(s), only received %d" , len (args ))
57
+ }
58
+
56
59
// Register the metric generator itself as marker so genall.FromOptions is able to initialize the runtime properly.
57
60
// This also registers the markers inside the optionsRegistry so its available to print the marker docs.
58
61
metricGenerator := generator.CustomResourceConfigGenerator {}
You can’t perform that action at this time.
0 commit comments