Skip to content

update fix pvc#2

Merged
KantharakornPH merged 1 commit into
masterfrom
fix/skip-pvc-creation-case-volumn-existing-secret
Sep 24, 2025
Merged

update fix pvc#2
KantharakornPH merged 1 commit into
masterfrom
fix/skip-pvc-creation-case-volumn-existing-secret

Conversation

@PhennyOpsta
Copy link
Copy Markdown

For volumes, if an existingSecret is specified, a PersistentVolumeClaim (PVC) will not be created.

@KantharakornPH KantharakornPH merged commit 4852c7a into master Sep 24, 2025
1 check passed
@gemini-code-assist
Copy link
Copy Markdown

Summary of Changes

Hello @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 existingSecret. This ensures that the system correctly handles secret-backed volumes without attempting to provision a storage claim, aligning with scenarios where secrets provide the necessary volume data. The change is accompanied by a new test to confirm the intended behavior.

Highlights

  • PVC Creation Logic: Modified the Helm chart's PVC creation logic to prevent the automatic generation of a PersistentVolumeClaim (PVC) when a volume is configured to use an existingSecret.
  • Test Coverage: Added a new test case to pvc_test.yaml to explicitly verify that no PVC is created when an existingSecret is specified for a volume.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a 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 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.

Comment on lines +49 to +57
- 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
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please suggest how to modify values.schema.json?

@winggundamth winggundamth deleted the fix/skip-pvc-creation-case-volumn-existing-secret branch October 26, 2025 19:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants