Skip to content
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

Enhance volume template to support dynamic values with templating #82

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

lanzmlt
Copy link
Contributor

@lanzmlt lanzmlt commented Dec 11, 2024

  • Updated volume template to use tpl for processing dynamic values in .name, .originalName, and .defaultMode.
  • Improved flexibility by allowing templated strings (e.g., {{ $.Values.environment }}) to be resolved during rendering.
  • Retained compatibility with existing logic for items and additional properties.
  • Added support for dynamic context evaluation, enabling better integration with Helm value overrides.

- Updated volume template to use `tpl` for processing dynamic values in `.name`, `.originalName`, and `.defaultMode`.
- Improved flexibility by allowing templated strings (e.g., `{{ $.Values.environment }}`) to be resolved during rendering.
- Retained compatibility with existing logic for items and additional properties.
- Added support for dynamic context evaluation, enabling better integration with Helm value overrides.
Replaced `helpers.app.fullname` with `helpers.tplvalues.render` for resolving `claimName` in PVC volumes.
@emelyanovvictor
Copy link
Contributor

Hi, could you provide a specific example of a values file that clearly demonstrates the benefits of this approach, especially in relation to the .name and .originalName values?

P.S. In the PR, you added the .items field for persistentVolumeClaim, but this field is not applicable to PVCs. Additionally, you need to ensure that the name in the template for creating volumes (PVC, Secret, or ConfigMap) is also updated and matches the volume name when mounting it in the pod template.

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.

2 participants