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

Fixing issue 2266 #3326

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Fixing issue 2266 #3326

wants to merge 3 commits into from

Conversation

midnattsol
Copy link

@midnattsol midnattsol commented Mar 6, 2024

When PolicyClaim is Delete the pv are not removed. Instead of this they stay as Available.

I've modified the sync_volumes.go to add this

	// Check if the PV has ReclaimPolicy "Delete".
	if pv.Spec.PersistentVolumeReclaimPolicy == corev1.PersistentVolumeReclaimDelete {
		log.Info("Skipping manipulation for PV with 'Delete' reclaim policy", "pv", pv.Name)
		// For PVs with ReclaimPolicy "Delete", we don't need to do anything.
		return nil, nil
	}

So in case the policyClaim is Delete the controller doesn't try to modify the volume, and k8s can remove it.

In my company we're currently working with this patch in production, and it works, using a custom image in dockerhub.

Fixes #2266

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.

PV build up with Reclaim policy set Delete
2 participants