-
-
Notifications
You must be signed in to change notification settings - Fork 243
feat(lxc): add env parameter support
#2383
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
Signed-off-by: Simon Caron <[email protected]>
Signed-off-by: Simon Caron <[email protected]>
Summary of ChangesHello @simoncaron, 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 Proxmox Terraform provider by adding support for configuring environment variables within LXC containers. This new functionality allows users to specify key-value pairs that will be passed to the container's init process, enabling advanced configurations such as NVIDIA passthrough. The implementation includes a new Go type for environment variables and custom marshaling/unmarshaling logic to seamlessly integrate with the Proxmox API's unique NUL-separated string format for these variables. Highlights
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 adds support for setting environment variables in LXC containers. The changes include updating the API types to handle a NUL-separated string for environment variables, modifying the Terraform resource to expose this new environment_variables map attribute, and adding corresponding documentation and tests. The implementation is solid, but I have a few suggestions to improve robustness by handling empty environment variable keys and to refactor a small piece of code for better maintainability.
Signed-off-by: Simon Caron <[email protected]>
Signed-off-by: Simon Caron <[email protected]>
Signed-off-by: Simon Caron <[email protected]>
Signed-off-by: Simon Caron <[email protected]>
2b7a3f3 to
2bc8346
Compare
env parameter supportenv parameter support
bpg
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.
@simoncaron Thank you for another good feature! ❤️
I've added a test, and also fixed consistent ordering of the env keys.
LGTM! 🚀
Contributor's Note
/docsfor any user-facing features or additions./fwprovider/testsfor any new or updated resources / data sources.make exampleto verify that the change works as expected.Add support for
envvariables in LXC Containers Configuration. These variables are used by the container init Process, for example when using NVIDIA passthrough:I added a new
CustomEnvironmentVariablestype to handle key/values, added custom logic to handle the value from and to the Proxmox API since the field is NUL-separated string that contains all environment variables.Proof of Work
Config (through a module in this case)
Change preview and apply
In the container
Community Note
Closes #2382 | Relates #2382