Fix status command failing with non-default port#132
Fix status command failing with non-default port#132carole-lavillonniere merged 1 commit intomainfrom
Conversation
127d0f9 to
79c8e57
Compare
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the 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 configurationConfiguration used: Repository UI (base), Organization UI (inherited) Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (6)
✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
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. Comment |
79c8e57 to
452af44
Compare
Motivation
lstk statuswas 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
statusnow reads the actual host port from Docker's port bindings viaGetBoundPort, falling back to the config port if unavailableGetBoundPortto theRuntimeinterface, implemented inDockerRuntimeand the mockstartTestContainerandstartTestContainerWithPortBindinginto a single variadic functionTests
Added
TestStatusCommandWorksWithNonDefaultPort: starts a container with a non-default port binding, writes a config with the wrong port (4566), and verifies thatlstk statusstill connects successfully using Docker's actual bound port.Closes DRG-642