Repository navigation
Conversation
Podman does not create /.dockerenv, and cgroup v2 under crun contains neither docker nor containerd, so isRunningInDocker returned false and the OAuth callback bound to the container-internal loopback. Published ports are delivered to eth0, so the browser login could never complete. Detect Podman via container=podman and /run/.containerenv. Move the container marker paths to variables so tests can point them at fixtures. Fixes github#4007
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
With Podman host networking, fixed-port callbacks expose login to network-triggered aborts, while reachable random ports unnecessarily force device flow.
1 open issue
What changed in this PR
Extends OAuth container detection to Podman so published fixed-port callbacks use the existing container binding behavior, addressing #4007.
Changes:
- Detects Podman environment and filesystem markers while preserving Docker/containerd checks.
- Adds configurable marker paths and unit tests.
| File | Description |
|---|---|
internal/oauth/env.go |
Adds Podman detection and fixture-configurable marker paths. |
internal/oauth/env_test.go |
Tests Podman markers, their absence, and Linux integration. |
Review effort: Max (adaptive)
Comment on lines
+67
to
+68
| if isPodmanContainer() { | ||
| return true |
Contributor
AI Assessment: Missing DetailsThanks for the contribution. Please edit the description to fill in these
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Problem
Under Podman, OAuth login with a fixed callback port never completes.
isRunningInDocker()only checks/.dockerenvand/proc/1/cgroup; Podman creates/run/.containerenvand, with cgroup v2 + crun,/proc/1/cgroupis0::/. The server therefore believes it is running natively, binds the callback to the container-internal127.0.0.1, and a published port (-p 127.0.0.1:8085:8085) can never reach it.Fixes #4007.
Change
container=podmanenvironment variable and/run/.containerenv.Once detected as containerized, the existing flow binds the callback to all interfaces, so the published port works as documented.
Tests
go test ./internal/oauth/passes. New tests cover:container=podmanenvironment marker/run/.containerenvmarkerisRunningInDocker()path undercontainer=podman(skipped on non-Linux)I could not exercise a real Podman container on this machine; the unit tests validate detection, and the interface-binding behavior is covered by the existing flow tests.