Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gracefully handle no args being passed to entrypoint #3589

Merged
merged 1 commit into from
Jul 15, 2024

Conversation

rgmz
Copy link
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

@nabokihms nabokihms merged commit 6fca251 into dexidp:master Jul 15, 2024
9 of 10 checks passed
@nabokihms
Copy link
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