Skip to content

Fix --container-id to produce log output#1851

Open
airblade wants to merge 1 commit into
basecamp:mainfrom
airblade:fix-container-id
Open

Fix --container-id to produce log output#1851
airblade wants to merge 1 commit into
basecamp:mainfrom
airblade:fix-container-id

Conversation

@airblade
Copy link
Copy Markdown
Contributor

@airblade airblade commented May 5, 2026

In order to pipe echo into xargs the command needs to run under a shell.

Fixes #1841

In order to pipe echo into xargs the command needs to run under a shell.

Fixes basecamp#1841
Copilot AI review requested due to automatic review settings May 5, 2026 14:48
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes kamal app logs --container-id so the provided container ID is emitted from a shell command before being piped into xargs docker logs, matching how the rest of the command pipeline is executed.

Tip

If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.

Changes:

  • Wrap string/symbol container_id values in sh -c before piping to xargs.
  • Update command-level expectations for logs and follow_logs to reflect the new shell-wrapped form.
  • Update CLI follow-log test coverage for the adjusted SSH command quoting.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
lib/kamal/commands/app/logging.rb Fixes command construction for explicit container IDs so piped log retrieval works.
test/commands/app_test.rb Updates low-level command output expectations for log commands using container_id.
test/cli/app_test.rb Updates CLI follow-log expectation to match the new shell-wrapped SSH command.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@airblade
Copy link
Copy Markdown
Contributor Author

airblade commented May 5, 2026

BTW the CI test failures are nothing to do with this change.

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.

kamal app logs --container_id=CONTAINER_ID returns no log output

2 participants