-
Notifications
You must be signed in to change notification settings - Fork 115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Check if krunkit process is running #762
Conversation
Reviewer's Guide by SourceryThis PR enhances the container_manager logic in ramalama/common.py by adding a subprocess check for the 'krunkit' process. If 'krunkit' is running, the function immediately returns 'podman', mitigating issues caused by inconsistent podman machine listing across versions. No diagrams generated as the changes look simple and do not need a visual representation. File-Level Changes
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @ericcurtin - I've reviewed your changes - here's some feedback:
Overall Comments:
- Wrap the subprocess.run call in a try/except to handle potential exceptions (e.g., FileNotFoundError) if 'pgrep' isn't available.
- Confirm that returning 'podman' immediately when 'krunkit' is running aligns with the intended darwin-specific logic.
Here's what I looked at during the review
- 🟢 General issues: all looks good
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
ramalama/common.py
Outdated
@@ -35,6 +35,10 @@ def container_manager(): | |||
if sys.platform != "darwin": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
issue (code-quality): We've found these issues:
- Extract code out into function (
extract-method
) - Replace if statement with if expression [×2] (
assign-if-exp
) - Lift code into else after jump in control flow (
reintroduce-else
) - Replace multiple comparisons of same variable with
in
operator (merge-comparisons
)
0bcfbdb
to
7b2fe00
Compare
The podman machine list technique isn't consisent across podman machine versions. Signed-off-by: Eric Curtin <[email protected]>
7b2fe00
to
c1f331e
Compare
|
||
if available("docker"): | ||
return "docker" | ||
|
||
return None | ||
|
||
|
||
def is_krunkit_running(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Try first with --all-providers
This should be in newer podman's
Re-opened here #763 |
The podman machine list technique isn't consisent across podman machine versions.
Summary by Sourcery
Bug Fixes: