mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-24 12:15:52 +00:00
tests: Clarifies agnhost's entrypoint-tester's usage
Some of the entrypoint-tester related tests overrides agnhost's default entrypoint with agnhost-2, and this function's args will only contain the subcommand's args (./agnhost entrypoint-tester these args), but we need to print *all* the args, which is why os.Args should be printed instead.
This commit is contained in:
parent
af5c0c9e09
commit
54be382552
@ -40,7 +40,9 @@ ADD porter/localhost.key localhost.key
|
||||
|
||||
ADD agnhost agnhost
|
||||
|
||||
# needed for the entrypoint-tester related tests.
|
||||
# needed for the entrypoint-tester related tests. Some of the entrypoint-tester related tests
|
||||
# overrides this image's entrypoint with agnhost-2 binary, and will verify that the correct
|
||||
# entrypoint is used by the containers.
|
||||
RUN ln -s agnhost agnhost-2
|
||||
|
||||
ENTRYPOINT ["/agnhost"]
|
||||
|
@ -31,8 +31,12 @@ var CmdEntrypointTester = &cobra.Command{
|
||||
Run: main,
|
||||
}
|
||||
|
||||
// This program prints the arguments it's passed and exits.
|
||||
// This program prints all the executable's arguments and exits.
|
||||
func main(cmd *cobra.Command, args []string) {
|
||||
// Some of the entrypoint-tester related tests overrides agnhost's default entrypoint
|
||||
// with agnhost-2, and this function's args will only contain the subcommand's
|
||||
// args (./agnhost entrypoint-tester these args), but we need to print *all* the
|
||||
// args, which is why os.Args should be printed instead.
|
||||
fmt.Printf("%v\n", os.Args)
|
||||
os.Exit(0)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user