tests: Sets MaximumNArgs for agnhost subcommands to 0

The subcommands rely on flags, not args. Because of this, the
cobra.MaximumNArgs should be set 0.
This commit is contained in:
Claudiu Belu 2019-06-12 20:37:56 -07:00
parent bad9e15509
commit b633031ec5
3 changed files with 3 additions and 3 deletions

View File

@ -44,7 +44,7 @@ var CmdLogsGenerator = &cobra.Command{
Use: "logs-generator",
Short: "Outputs lines of logs to stdout uniformly",
Long: "Outputs <linesTotal> lines of logs to stdout uniformly for <duration>",
Args: cobra.MaximumNArgs(2),
Args: cobra.MaximumNArgs(0),
Run: generateLogs,
}

View File

@ -31,7 +31,7 @@ var CmdNoSnatTestProxy = &cobra.Command{
Use: "no-snat-test-proxy",
Short: "Creates a proxy for the /checknosnat endpoint",
Long: `Creates the /checknosnat endpoint which proxies the request to the given target (/checknosnat?target=target_ip&ips=ip1,ip2) and returns its response, or a 500 response on error.`,
Args: cobra.MaximumNArgs(1),
Args: cobra.MaximumNArgs(0),
Run: main,
}

View File

@ -37,7 +37,7 @@ var CmdNoSnatTest = &cobra.Command{
- /whoami - returns the request's IP address.
- /checknosnat - queries "ip/whoami" for each provided IP ("/checknosnat?ips=ip1,ip2"),
and if all the response bodies match the "POD_IP" environment variable, it will return a 200 response, 500 otherwise.`,
Args: cobra.MaximumNArgs(1),
Args: cobra.MaximumNArgs(0),
Run: main,
}