update fix pvc#2
Conversation
Summary of ChangesHello @PhennyOpsta, 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 refines the volume provisioning mechanism within the common Helm chart. It introduces a change that prevents the creation of a PersistentVolumeClaim (PVC) when a volume definition explicitly references an 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.
Code Review
This pull request correctly prevents the creation of a PersistentVolumeClaim (PVC) when a volume is configured to use an existingSecret. The change is implemented by updating the conditional logic in the PVC template, and a new test case has been added to verify this behavior, which is excellent. I have one suggestion for improvement related to the chart's values.schema.json which is detailed in a specific comment.
| - it: Should not generate a claim when using existingSecret | ||
| set: | ||
| volumes: | ||
| - name: data | ||
| path: /var/lib/1clickinfra/data | ||
| existingSecret: my-existing-secret | ||
| asserts: | ||
| - hasDocuments: | ||
| count: 0 |
There was a problem hiding this comment.
This test case is a great addition to verify that no PVC is created when existingSecret is used. However, it highlights an inconsistency in values.schema.json.
This test correctly includes the name property for the volume, which is required by the common.volumesRef.tpl template to name the volume mount. However, the schema definition for volumes using existingSecret (under properties.volumes.items.anyOf) is missing this name property. This is also the case for volumes using existingConfigMap.
This discrepancy can lead to validation errors for users. To improve the chart's robustness and user experience, I recommend updating values.schema.json to include the name property in the schema for existingSecret volumes and make it required.
There was a problem hiding this comment.
please suggest how to modify values.schema.json?
For volumes, if an existingSecret is specified, a PersistentVolumeClaim (PVC) will not be created.