Skip to content

Fix status command failing with non-default port#132

Merged
carole-lavillonniere merged 1 commit intomainfrom
carole/drg-642
Mar 18, 2026
Merged

Fix status command failing with non-default port#132
carole-lavillonniere merged 1 commit intomainfrom
carole/drg-642

Conversation

@carole-lavillonniere
Copy link
Copy Markdown
Collaborator

@carole-lavillonniere carole-lavillonniere commented Mar 18, 2026

Motivation

lstk status was always using the port from config to reach LocalStack's HTTP API. If the user changed the config port while a container was still running on the old port, status would try the wrong port and return a connection refused error.

Changes

  • status now reads the actual host port from Docker's port bindings via GetBoundPort, falling back to the config port if unavailable
  • Added GetBoundPort to the Runtime interface, implemented in DockerRuntime and the mock
  • Merged startTestContainer and startTestContainerWithPortBinding into a single variadic function

Tests

Added TestStatusCommandWorksWithNonDefaultPort: starts a container with a non-default port binding, writes a config with the wrong port (4566), and verifies that lstk status still connects successfully using Docker's actual bound port.

Closes DRG-642

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 18, 2026

Warning

Rate limit exceeded

@carole-lavillonniere has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 20 minutes and 43 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Run ID: 6679e3bf-187c-402a-838f-909434202074

📥 Commits

Reviewing files that changed from the base of the PR and between be57d23 and 452af44.

📒 Files selected for processing (6)
  • internal/container/status.go
  • internal/runtime/docker.go
  • internal/runtime/mock_runtime.go
  • internal/runtime/runtime.go
  • test/integration/main_test.go
  • test/integration/status_test.go
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch carole/drg-642
📝 Coding Plan
  • Generate coding plan for human review comments

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 and usage tips.

Copy link
Copy Markdown
Member

@silv-io silv-io left a comment

Choose a reason for hiding this comment

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

LGTM!

@carole-lavillonniere carole-lavillonniere merged commit 269272a into main Mar 18, 2026
8 checks passed
@carole-lavillonniere carole-lavillonniere deleted the carole/drg-642 branch March 18, 2026 10:49
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.

2 participants