Skip to content

log container name instead of container id (fixes #132)#160

Merged
wollomatic merged 1 commit into
mainfrom
132-container-names-instead-of-id
Jul 25, 2026
Merged

log container name instead of container id (fixes #132)#160
wollomatic merged 1 commit into
mainfrom
132-container-names-instead-of-id

Conversation

@wollomatic

@wollomatic wollomatic commented Jul 25, 2026

Copy link
Copy Markdown
Owner

Summary by CodeRabbit

  • Enhancements

    • Docker allowlist entries now display the container name in JSON and plain-text output.
    • Docker event and bind-mount restriction logs now use the container name where available.
    • Container identifiers are used as a fallback when a name cannot be resolved.
  • Bug Fixes

    • Improved handling of containers with missing or unusually short identifiers.

@wollomatic wollomatic self-assigned this Jul 25, 2026
@wollomatic wollomatic linked an issue Jul 25, 2026 that may be closed by this pull request
@coderabbitai

coderabbitai Bot commented Jul 25, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 50751642-968f-4fe2-b85a-97346018f10d

📥 Commits

Reviewing files that changed from the base of the PR and between f331ab8 and 86c48d1.

📒 Files selected for processing (2)
  • internal/config/config.go
  • internal/config/config_test.go

Walkthrough

Allowlist entries now retain Docker container names, with short-ID fallbacks when names are unavailable. Lifecycle logs and allowlist output use the resolved names, and tests cover container and event name resolution.

Changes

Container name logging

Layer / File(s) Summary
Store names in allowlists
internal/config/config.go
AllowList stores ContainerName, and initial or event-driven entries populate it while standardising short-ID fallback logging.
Resolve event and container names
internal/config/config.go, internal/config/config_test.go
Name helpers resolve Docker names from containers or event attributes, and tests cover named, fallback, and short-ID cases. Docker lifecycle logs use the resolved values.
Render resolved names
internal/config/config.go
JSON, plain-text, and bind-mount restriction output uses ContainerName.

Estimated code review effort: 2 (Simple) | ~10 minutes

Poem

I’m a rabbit with a name in the log,
No more ID-slice hopping through fog.
If names disappear, short IDs remain,
Allow lists bloom with a clearer refrain.
Hop, hop—Docker speaks plainly again!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: logging container names instead of container IDs.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch 132-container-names-instead-of-id

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@wollomatic
wollomatic merged commit be93f96 into main Jul 25, 2026
7 checks passed
@wollomatic
wollomatic deleted the 132-container-names-instead-of-id branch July 26, 2026 16:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

container names instead of id

1 participant