Rename the Deletable interface to Orphanable
This interface represents a resource with a deletion policy; i.e. a resource whose underlying external resource may either be deleted or orphaned when the it is deleted. Signed-off-by: Nic Cope <negz@rk0n.org>
This commit is contained in:
parent
5c5d8932d3
commit
72cd5521e6
|
@ -769,7 +769,7 @@ func TestShouldDelete(t *testing.T) {
|
||||||
"DeletionPolicyDelete": {
|
"DeletionPolicyDelete": {
|
||||||
reason: "The delete deletion policy should take precedence over the reclaim policy.",
|
reason: "The delete deletion policy should take precedence over the reclaim policy.",
|
||||||
mg: &fake.Managed{
|
mg: &fake.Managed{
|
||||||
Deletable: fake.Deletable{Policy: v1alpha1.DeletionDelete},
|
Orphanable: fake.Orphanable{Policy: v1alpha1.DeletionDelete},
|
||||||
Reclaimer: fake.Reclaimer{Policy: v1alpha1.ReclaimRetain},
|
Reclaimer: fake.Reclaimer{Policy: v1alpha1.ReclaimRetain},
|
||||||
},
|
},
|
||||||
want: true,
|
want: true,
|
||||||
|
@ -777,7 +777,7 @@ func TestShouldDelete(t *testing.T) {
|
||||||
"DeletionPolicyOrphan": {
|
"DeletionPolicyOrphan": {
|
||||||
reason: "The orphan deletion policy should take precedence over the reclaim policy.",
|
reason: "The orphan deletion policy should take precedence over the reclaim policy.",
|
||||||
mg: &fake.Managed{
|
mg: &fake.Managed{
|
||||||
Deletable: fake.Deletable{Policy: v1alpha1.DeletionOrphan},
|
Orphanable: fake.Orphanable{Policy: v1alpha1.DeletionOrphan},
|
||||||
Reclaimer: fake.Reclaimer{Policy: v1alpha1.ReclaimDelete},
|
Reclaimer: fake.Reclaimer{Policy: v1alpha1.ReclaimDelete},
|
||||||
},
|
},
|
||||||
want: false,
|
want: false,
|
||||||
|
|
|
@ -135,14 +135,14 @@ func (m *Reclaimer) SetReclaimPolicy(p v1alpha1.ReclaimPolicy) { m.Policy = p }
|
||||||
// GetReclaimPolicy gets the ReclaimPolicy.
|
// GetReclaimPolicy gets the ReclaimPolicy.
|
||||||
func (m *Reclaimer) GetReclaimPolicy() v1alpha1.ReclaimPolicy { return m.Policy }
|
func (m *Reclaimer) GetReclaimPolicy() v1alpha1.ReclaimPolicy { return m.Policy }
|
||||||
|
|
||||||
// Deletable implements the Deletable interface.
|
// Orphanable implements the Orphanable interface.
|
||||||
type Deletable struct{ Policy v1alpha1.DeletionPolicy }
|
type Orphanable struct{ Policy v1alpha1.DeletionPolicy }
|
||||||
|
|
||||||
// SetDeletionPolicy sets the DeletionPolicy.
|
// SetDeletionPolicy sets the DeletionPolicy.
|
||||||
func (m *Deletable) SetDeletionPolicy(p v1alpha1.DeletionPolicy) { m.Policy = p }
|
func (m *Orphanable) SetDeletionPolicy(p v1alpha1.DeletionPolicy) { m.Policy = p }
|
||||||
|
|
||||||
// GetDeletionPolicy gets the DeletionPolicy.
|
// GetDeletionPolicy gets the DeletionPolicy.
|
||||||
func (m *Deletable) GetDeletionPolicy() v1alpha1.DeletionPolicy { return m.Policy }
|
func (m *Orphanable) GetDeletionPolicy() v1alpha1.DeletionPolicy { return m.Policy }
|
||||||
|
|
||||||
// CredentialsSecretReferencer is a mock that satisfies CredentialsSecretReferencer
|
// CredentialsSecretReferencer is a mock that satisfies CredentialsSecretReferencer
|
||||||
// interface.
|
// interface.
|
||||||
|
@ -281,7 +281,7 @@ type Managed struct {
|
||||||
ClaimReferencer
|
ClaimReferencer
|
||||||
ProviderReferencer
|
ProviderReferencer
|
||||||
ConnectionSecretWriterTo
|
ConnectionSecretWriterTo
|
||||||
Deletable
|
Orphanable
|
||||||
Reclaimer
|
Reclaimer
|
||||||
v1alpha1.ConditionedStatus
|
v1alpha1.ConditionedStatus
|
||||||
v1alpha1.BindingStatus
|
v1alpha1.BindingStatus
|
||||||
|
|
|
@ -84,8 +84,8 @@ type Reclaimer interface {
|
||||||
GetReclaimPolicy() v1alpha1.ReclaimPolicy
|
GetReclaimPolicy() v1alpha1.ReclaimPolicy
|
||||||
}
|
}
|
||||||
|
|
||||||
// A Deletable may specify a DeletionPolicy.
|
// An Orphanable resource may specify a DeletionPolicy.
|
||||||
type Deletable interface {
|
type Orphanable interface {
|
||||||
SetDeletionPolicy(p v1alpha1.DeletionPolicy)
|
SetDeletionPolicy(p v1alpha1.DeletionPolicy)
|
||||||
GetDeletionPolicy() v1alpha1.DeletionPolicy
|
GetDeletionPolicy() v1alpha1.DeletionPolicy
|
||||||
}
|
}
|
||||||
|
@ -193,7 +193,7 @@ type Managed interface {
|
||||||
ClaimReferencer
|
ClaimReferencer
|
||||||
ProviderReferencer
|
ProviderReferencer
|
||||||
ConnectionSecretWriterTo
|
ConnectionSecretWriterTo
|
||||||
Deletable
|
Orphanable
|
||||||
Reclaimer
|
Reclaimer
|
||||||
|
|
||||||
Conditioned
|
Conditioned
|
||||||
|
|
Loading…
Reference in New Issue