Skip to content
This repository has been archived by the owner on Oct 21, 2020. It is now read-only.

Provide a shouldDelete hook in Qualifier interface #1044

Closed
jian-he opened this issue Nov 1, 2018 · 2 comments · Fixed by kubernetes-sigs/sig-storage-lib-external-provisioner#3
Labels

Comments

@jian-he
Copy link

jian-he commented Nov 1, 2018

Currently, the Qualifier has a ShouldProvision hook for external-provisioner to determine whether shouldProvision or not.

// Qualifier is an optional interface implemented by provisioners to determine
// whether a claim should be provisioned as early as possible (e.g. prior to
// leader election).
type Qualifier interface {
	// ShouldProvision returns whether provisioning for the claim should
	// be attempted.
	ShouldProvision(*v1.PersistentVolumeClaim) bool
}

Similarly, we can add a shouldDelete hook for external-provisioner to determine whether to delete the PV or not. - we implemented a custom provisioner and would like to inject logic for deletion such as time-based or space-based deletion policy.

shouldDelete(volume *v1.PersistentVolume) bool

@jsafrane , does this make sense ?

@wongma7
Copy link
Contributor

wongma7 commented Nov 1, 2018

yes, can be added. note that in the meantime there is also the option for Delete to return IgnoredError. The difference is that ShouldProvision/ShouldDelete gets called before Delete even gets called.

@zhangxiaoyu-zidif
Copy link

great! we can add this method to avoid many outer processes. thumbs up.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
3 participants