This repository was archived by the owner on Apr 15, 2026. It is now read-only.
Conversation
Move duplicated code from podmanRuntime and appleRuntime into the shared baseRuntime struct using a strategy pattern. This eliminates ~90 lines of duplicate code and ensures consistent behavior between runtimes. Changes: - Add containerParser interface for runtime-specific JSON parsing - Move Run, Exec, Stop, Start, Remove, Get, List, Build methods to baseRuntime - Add listArgs field to baseRuntime for runtime-specific list commands (Podman uses "ps -a", Apple uses "list") - Concrete runtimes now only implement JSON parsing via containerParser - Fix Apple runtime to parse CreatedAt timestamp (was always zero before) The refactoring ensures both runtimes behave identically for all operations, with only the JSON parsing differing based on each CLI's output format.
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
headjack | 0bd7116 | Commit Preview URL Branch Preview URL |
Jan 02 2026, 11:39 PM |
Add defensive nil checks for r.parser in Get() and List() methods to prevent panics if a runtime is constructed without initializing the parser field. Returns ErrNoParser sentinel error instead of panicking.
jmgilman
added a commit
that referenced
this pull request
Jan 3, 2026
…time Current behavior: podmanRuntime and appleRuntime had ~90 lines of duplicated code with identical implementations for Run, Exec, Stop, Start, Remove, Get, List, and Build methods New behavior: All common functionality moved to shared baseRuntime struct using strategy pattern. Concrete runtimes only implement JSON parsing via containerParser interface. Apple runtime now correctly parses CreatedAt timestamp instead of always returning zero value. Closes: #33
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Move duplicated code from podmanRuntime and appleRuntime into the shared baseRuntime struct using a strategy pattern. This eliminates ~90 lines of duplicate code and ensures consistent behavior between runtimes.
Changes:
The refactoring ensures both runtimes behave identically for all operations, with only the JSON parsing differing based on each CLI's output format.