Skip to content

Porting helm fixes#818

Open
desmax74 wants to merge 1 commit into
trustification:release/2.y.zfrom
desmax74:fixHelmStorage
Open

Porting helm fixes#818
desmax74 wants to merge 1 commit into
trustification:release/2.y.zfrom
desmax74:fixHelmStorage

Conversation

@desmax74
Copy link
Copy Markdown
Collaborator

@desmax74 desmax74 commented May 19, 2026

See this guacsec/trustify-helm-charts#89

Summary by Sourcery

Port PVC handling and storage integration fixes into the common Helm templates for the trusted profile analyzer chart.

Enhancements:

  • Move the storage PersistentVolumeClaim template from the server-specific path to a common location and add Helm hook annotations to preserve the PVC across installs and upgrades.
  • Wire shared storage volumes, mounts, and environment variables into the migrate-database init Job to ensure it can access the configured storage backend.

@desmax74 desmax74 requested a review from ctron May 19, 2026 16:32
@sourcery-ai
Copy link
Copy Markdown

sourcery-ai Bot commented May 19, 2026

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Ports and generalizes the storage PVC template and wires storage configuration into the migrate-database init Job, including Helm hook annotations and volume/env wiring.

File-Level Changes

Change Details Files
Generalize and move the storage PersistentVolumeClaim template and add Helm lifecycle annotations.
  • Remove server-module-specific enablement guard so the PVC can be reused more broadly
  • Move/rename the PVC template under a common path for shared usage
  • Add Helm hook annotations for pre-install and pre-upgrade execution
  • Mark the PVC with a resource policy of keep to avoid deletion on uninstall
helm-charts/redhat-trusted-profile-analyzer/templates/services/server/010-PersistentVolumeClaim-storage.yaml
helm-charts/redhat-trusted-profile-analyzer/templates/common/010-PersistentVolumeClaim-storage.yaml
Wire storage volumes and configuration into the migrate-database Job.
  • Include the shared storage volume definition in the Job's volumes section
  • Inject storage-related environment variables into the migrate-database container
  • Mount the shared storage volume into the migrate-database container
  • Keep existing postgres and extra volume/volumeMount configuration unchanged while extending with storage wiring
helm-charts/redhat-trusted-profile-analyzer/templates/init/migrate-database/020-Job.yaml

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@desmax74 desmax74 requested a review from m-brophy May 19, 2026 16:32
Copy link
Copy Markdown

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

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

Hey - I've left some high level feedback:

  • Moving the PVC template from services/server into templates/common and removing the .Values.modules.server.enabled guard will make this PVC render for all modules; if the PVC is meant to be server-specific, consider reintroducing a more targeted condition.
  • With the new helm.sh/resource-policy: keep annotation on the PVC, consider whether you also want a separate cleanup or migration path documented in values or charts, since Helm will no longer manage deletion of this resource.
  • The migrate-database Job now always includes storage volumes and env vars; if storage is only applicable for certain configurations or storage.type values, you may want to wrap these includes with the same condition used around the PVC to avoid unnecessary or inconsistent volume definitions.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Moving the PVC template from `services/server` into `templates/common` and removing the `.Values.modules.server.enabled` guard will make this PVC render for all modules; if the PVC is meant to be server-specific, consider reintroducing a more targeted condition.
- With the new `helm.sh/resource-policy: keep` annotation on the PVC, consider whether you also want a separate cleanup or migration path documented in values or charts, since Helm will no longer manage deletion of this resource.
- The migrate-database Job now always includes storage volumes and env vars; if storage is only applicable for certain configurations or `storage.type` values, you may want to wrap these includes with the same condition used around the PVC to avoid unnecessary or inconsistent volume definitions.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@desmax74
Copy link
Copy Markdown
Collaborator Author

@mrrajan

Copy link
Copy Markdown

@ctron ctron left a comment

Choose a reason for hiding this comment

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

So this might work during an (initial) installation. But does it also work on an upgrade?

Signed-off-by: desmax74 <mdessi@redhat.com>
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