Skip to content

feat: allow setting PersistentVolumeClaimRetentionPolicy#252

Open
ed-marks wants to merge 2 commits intoakyriako:mainfrom
ed-marks:ed/pvc-retention
Open

feat: allow setting PersistentVolumeClaimRetentionPolicy#252
ed-marks wants to merge 2 commits intoakyriako:mainfrom
ed-marks:ed/pvc-retention

Conversation

@ed-marks
Copy link
Copy Markdown

@ed-marks ed-marks commented Mar 20, 2026

Adds support for configuring StatefulSet PVC retention via spec.storage.persistentVolumeClaimRetentionPolicy on TypesenseCluster.

This lets you control what happens to PVCs on scale-down or cluster deletion (Retain/Delete) by wiring the CRD field through to the generated StatefulSet. I've added to the base sample what that looks like.

The main use case for me is short-lived test clusters, where PVCs should be cleaned up automatically when clusters are torn down, while still leaving production-like defaults.

I also noticed the local kind cluster was named incorrectly and there was a suspect OR condition flagged by go vet which always evaluated to true. I believe it was mean to be "when condition.Reason is neither ConditionReasonQuorumDowngraded or ConditionReasonQuorumQueuedWrites" which is what i've amended it to.

Also mostly FYI but running make helm overwrote a ton of stuff, almost all of which were out of scope of this PR. I've cherry-picked the bits of that this PR cares about.

@akyriako
Copy link
Copy Markdown
Owner

Hi @ed-marks thanks for the PR. Dont worry about the make helm changes, they are pre-release steps that shouldn't worry you. Please change PersistentVolumeClaimRetentionPolicy to RetentionPolicy because it is a mouthful and I would be glad closing the PR. Cheers!

@ed-marks
Copy link
Copy Markdown
Author

Hi @ed-marks thanks for the PR. Dont worry about the make helm changes, they are pre-release steps that shouldn't worry you. Please change PersistentVolumeClaimRetentionPolicy to RetentionPolicy because it is a mouthful and I would be glad closing the PR. Cheers!

Nice one thank you - I've made the rename, I'll see about manually testing it this week to make sure i've not missed anything

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