Skip to content

Commit

Permalink
Gracefully handle no args being passed to entrypoint (#3589)
Browse files Browse the repository at this point in the history
Signed-off-by: Richard Gomez <rmgomez368@gmail.com>
  • Loading branch information
rgmz authored Jul 15, 2024
1 parent 9024d4c commit 6fca251
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cmd/docker-entrypoint/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ func main() {
// Note that this docker-entrypoint program is args[0], and it is provided with the true process
// args.
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 {
fmt.Println("error:", err.Error())
Expand Down

0 comments on commit 6fca251

Please sign in to comment.