Skip to content
Snippets Groups Projects
Unverified Commit 6fca251d authored by Richard Gomez's avatar Richard Gomez Committed by GitHub
Browse files

Gracefully handle no args being passed to entrypoint (#3589)

parent 9024d4c7
No related branches found
No related tags found
No related merge requests found
...@@ -17,6 +17,10 @@ func main() { ...@@ -17,6 +17,10 @@ func main() {
// Note that this docker-entrypoint program is args[0], and it is provided with the true process // Note that this docker-entrypoint program is args[0], and it is provided with the true process
// args. // args.
args := os.Args[1:] args := os.Args[1:]
if len(args) == 0 {
fmt.Println("error: no args passed to entrypoint")
os.Exit(1)
}
if err := run(args, realExec, realWhich); err != nil { if err := run(args, realExec, realWhich); err != nil {
fmt.Println("error:", err.Error()) fmt.Println("error:", err.Error())
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment