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

Signed-off-by: Richard Gomez <rmgomez368@gmail.com>
This commit is contained in:
Richard Gomez
2024-07-15 20:07:38 +02:00
committed by GitHub
parent 9024d4c7eb
commit 6fca251dc1
+4
View File
@@ -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())