Repository navigation
[nats] Merge container spec, not podTemplate - #1571
Conversation
|
Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. WalkthroughThe NATS Helm template was restructured: container configuration moved from Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes
Possibly related issues
Poem
Pre-merge checks and finishing touches✅ Passed checks (2 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary of ChangesHello Timofei Larkin (@lllamnyp), 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 resolves a critical configuration issue within the NATS Helm chart where resource specifications were being applied incorrectly, leading to the complete loss of default container settings. By adjusting the merge strategy from 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 (@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.
Code Review
This pull request correctly fixes an issue in the NATS Helm chart where resource overrides were incorrectly wiping out the entire container spec. By changing the merge target from podTemplate to container, the resource requests and limits are now correctly merged. This is a good fix. I have one suggestion to improve the change further by removing a redundant and potentially problematic image override, letting the upstream chart manage its version.
| image: nats:2.10.17-alpine | ||
| resources: {{- include "cozy-lib.resources.defaultingSanitize" (list .Values.resourcesPreset .Values.resources $) | nindent 12 }} |
There was a problem hiding this comment.
While fixing the merge strategy is correct, explicitly setting the image here is redundant and potentially incorrect. The upstream cozy-nats chart already defaults to nats:2.10.17-alpine. More importantly, the upstream chart's values expect image to be an object with repository and tag keys, but here it's being set as a simple string. This will likely cause template rendering errors.
It's best to remove the image line and let the upstream chart manage the image version. This makes the wrapper chart more maintainable.
resources: {{- include "cozy-lib.resources.defaultingSanitize" (list .Values.resourcesPreset .Values.resources $) | nindent 12 }}## What this PR does The NATS chart incorrectly used podTemplate+merge instead of container+merge to add resource requests and limits to the NATS container in the statefulset, but as a result it just completely wiped out the default container spec. By moving the overrides under the container key, the upstream chart now correctly merges the resource requests, instead of overwriting the container spec. ### Release note ```release-note [nats] Fix incorrect path to container resources in the NATS chart. ``` Signed-off-by: Timofei Larkin <[email protected]>
fe4718f to
8b95db0
Compare
|
Successfully created backport PR for |
What this PR does
The NATS chart incorrectly used podTemplate+merge instead of container+merge to add resource requests and limits to the NATS container in the statefulset, but as a result it just completely wiped out the default container spec. By moving the overrides under the container key, the upstream chart now correctly merges the resource requests, instead of overwriting the container spec.
Release note
Summary by CodeRabbit