Improve recreate command flow - #30
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR improves the docker recreate CLI/plugin execution flow by returning friendly errors, normalizing container recreation inputs, and resolving image platform data more safely, while also adding unit tests and build-time version injection.
Changes:
- Refactors CLI entrypoint into a testable
run/runCommandflow with friendlier error handling and injectable Docker client. - Updates recreate behavior: platform resolution (descriptor-first, image-inspect fallback), optional image pulling, and safer networking/name handling.
- Adds unit tests for metadata output, direct invocation behavior, image pull consumption/closure, and auto-remove container handling; updates README and Makefile for version injection.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| main.go | Refactors CLI flow, adds build-injected version metadata, and improves recreate/platform/pull behavior with testable abstractions. |
| main_test.go | Adds unit tests covering metadata, invocation paths, pull behavior, platform resolution, and auto-remove behavior. |
| README.md | Fixes releases URL typo and clarifies usage for plugin vs direct binary invocation. |
| Makefile | Injects release version via ldflags and updates dependency fetching to go mod download. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
andreccosta
force-pushed
the
fix/recreate-command-flow
branch
from
March 14, 2026 16:51
ad42bc9 to
46cab6b
Compare
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.
Summary
Verification