Skip to content

Gracefully handle no args being passed to entrypoint#3589

Merged
nabokihms merged 1 commit into
dexidp:masterfrom
rgmz:master
Jul 15, 2024
Merged

Gracefully handle no args being passed to entrypoint#3589
nabokihms merged 1 commit into
dexidp:masterfrom
rgmz:master

Conversation

@rgmz
Copy link
Copy Markdown
Contributor

@rgmz rgmz commented Jun 20, 2024

Overview

This is a minor change to prevent a panic in an admittedly niche edge case.

What this PR does / why we need it

This PR gracefully handles no args being passed to the entrypoint binary.

# before
./docker-entrypoint
panic: runtime error: index out of range [0] with length 0
goroutine 1 [running]:
main.run({0xc000014140?, 0xc00006e740?, 0x0?}, 0x60?, 0x0?)
/usr/local/src/dex/cmd/docker-entrypoint/main.go:56 +0x5c5
main.main()
/usr/local/src/dex/cmd/docker-entrypoint/main.go:21 +0x65

# after
./docker-entrypoint 
error: no args passed to entrypoint

This can occur if someone builds upon the upstream dex image (e.g., adding internal company certificates) and inadvertently breaks the entrypoint/cmd.

Special notes for your reviewer

Signed-off-by: Richard Gomez <rmgomez368@gmail.com>
@nabokihms nabokihms merged commit 6fca251 into dexidp:master Jul 15, 2024
@nabokihms
Copy link
Copy Markdown
Member

Good catch! Thanks, @rgmz

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants