-
Notifications
You must be signed in to change notification settings - Fork 138
taprpc+scripts: detect Podman wrapper and preserve Docker UID mapping #1928
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
Conversation
Summary of ChangesHello @ffranr, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request enhances the Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
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.
Code Review
This pull request introduces logic to detect if podman is being used as a docker wrapper and adjusts the user arguments for docker run commands accordingly. This is a valuable change that fixes permission issues when using rootless Podman. The changes are applied to scripts/gen_sqlc_docker.sh and taprpc/gen_protos_docker.sh. My review focuses on improving the robustness and maintainability of the shell scripts. I've suggested quoting variables to prevent word splitting, extracting duplicated code into a shared helper script to adhere to the DRY principle, and fixing a minor indentation inconsistency to maintain a consistent coding style across the project.
Pull Request Test Coverage Report for Build 20787517435Details
💛 - Coveralls |
70df0f8 to
48e3b19
Compare
|
/gemini review |
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.
Code Review
This pull request effectively adds detection for Podman and adjusts the user mapping to prevent permission errors, while maintaining the existing behavior for Docker. The changes are consistently applied across the relevant Makefiles and shell scripts. I've added a couple of suggestions to refactor the Makefile logic to reduce code duplication and improve maintainability. Overall, this is a good improvement.
48e3b19 to
ef78182
Compare
|
/gemini review |
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.
Code Review
This pull request introduces detection for Podman and adjusts Docker command user arguments to resolve permission issues with rootless Podman, while maintaining existing behavior for Docker. The changes are well-structured, centralizing the detection logic in a new helper script and updating Makefiles and build scripts to use it. This is a good improvement for developer environment flexibility. I've added a few minor suggestions to quote the DOCKER variable in the shell scripts to improve their robustness.
ef78182 to
5d51b9c
Compare
|
/gemini review |
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.
Code Review
This pull request introduces detection for Podman to adjust user arguments, resolving permission errors with rootless setups while maintaining compatibility with Docker. The changes are well-implemented, centralizing detection logic in a new scripts/docker_helpers.sh script for shell files and using Makefile variables for make targets. This is a clean solution to the problem. My review includes a couple of suggestions to improve the robustness of the shell scripts by properly quoting variables.
5d51b9c to
1a8ff74
Compare
jtobin
left a comment
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.
LGTM. I used to do my own local munging of this stuff for podman use, but then eventually grudgingly adopted Docker. Maybe I should retvrn to podman now?
70df0f8 to
eba5688
Compare
Detect Podman by checking "$DOCKER --version", allowing overrides via the DOCKER environment variable. Retain "--user $UID:$(id -g)" for Docker/CI to ensure generated files are user-owned. For Podman, switch to "--user=0:0" to avoid EACCES errors caused by rootless subuid/subgid remapping on bind mounts. Changes: - scripts/docker_helpers.sh: new shared helper for Docker/Podman detection and user argument selection - scripts/gen_sqlc_docker.sh: source shared helper for container runtime detection; properly quote variables - taprpc/gen_protos_docker.sh: source shared helper for container runtime detection; properly quote variables - Makefile: add DOCKER variable and IS_PODMAN detection; update DOCKER_TOOLS, docker-release, and docker-tools targets to use configurable runtime - make/release_flags.mk: add Podman detection with conditional user args for DOCKER_RELEASE_HELPER Fixes "Permission denied" errors with rootless Podman, while preserving existing Docker behavior.
eba5688 to
6352452
Compare
darioAnongba
left a comment
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.
Podman for the win.
Detect Podman by checking "$DOCKER --version", allowing overrides via the DOCKER environment variable. Retain
--user $UID:$(id -g)for Docker/CI to ensure generated files are user-owned. For Podman, switch to "--user=0:0" to avoid EACCES errors caused by rootless subuid/subgid remapping on bind mounts.Fixes "Permission denied" errors with rootless Podman, while maintaining existing Docker behavior.