Remove reclaim policy from composite resources
See https://github.com/crossplane/crossplane-runtime/issues/179 for context. Signed-off-by: Nic Cope <negz@rk0n.org>
This commit is contained in:
parent
9a9a434f73
commit
c7b7ea8043
|
|
@ -143,17 +143,6 @@ func (c *Unstructured) SetWriteConnectionSecretToReference(ref *v1alpha1.SecretR
|
|||
_ = fieldpath.Pave(c.Object).SetValue("spec.writeConnectionSecretToRef", ref)
|
||||
}
|
||||
|
||||
// GetReclaimPolicy of this Composite resource.
|
||||
func (c *Unstructured) GetReclaimPolicy() v1alpha1.ReclaimPolicy {
|
||||
s, _ := fieldpath.Pave(c.Object).GetString("spec.reclaimPolicy")
|
||||
return v1alpha1.ReclaimPolicy(s)
|
||||
}
|
||||
|
||||
// SetReclaimPolicy of this Composite resource.
|
||||
func (c *Unstructured) SetReclaimPolicy(p v1alpha1.ReclaimPolicy) {
|
||||
_ = fieldpath.Pave(c.Object).SetValue("spec.reclaimPolicy", p)
|
||||
}
|
||||
|
||||
// GetCondition of this Composite resource.
|
||||
func (c *Unstructured) GetCondition(ct v1alpha1.ConditionType) v1alpha1.Condition {
|
||||
conditioned := v1alpha1.ConditionedStatus{}
|
||||
|
|
|
|||
|
|
@ -238,27 +238,3 @@ func TestWriteConnectionSecretToReference(t *testing.T) {
|
|||
})
|
||||
}
|
||||
}
|
||||
|
||||
func TestReclaimPolicy(t *testing.T) {
|
||||
cases := map[string]struct {
|
||||
u *Unstructured
|
||||
set v1alpha1.ReclaimPolicy
|
||||
want v1alpha1.ReclaimPolicy
|
||||
}{
|
||||
"NewRef": {
|
||||
u: New(),
|
||||
set: v1alpha1.ReclaimRetain,
|
||||
want: v1alpha1.ReclaimRetain,
|
||||
},
|
||||
}
|
||||
|
||||
for name, tc := range cases {
|
||||
t.Run(name, func(t *testing.T) {
|
||||
tc.u.SetReclaimPolicy(tc.set)
|
||||
got := tc.u.GetReclaimPolicy()
|
||||
if diff := cmp.Diff(tc.want, got); diff != "" {
|
||||
t.Errorf("\nu.GetReclaimPolicy(): -want, +got:\n%s", diff)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue