Skip to content

Commit

Permalink
Set object deletion policy on kubernetes objects
Browse files Browse the repository at this point in the history
  • Loading branch information
mproffitt committed Nov 10, 2023
1 parent 99e3337 commit abbdeaf
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/composite/functions.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func ToUnstructured(apiVersion, kind, object any) (objectSpec *unstructured.Unst

// ToUnstructuredKubernetesObject is a helper function that wraps a given CR resource in
// a `crossplane-contrib/provider-kubernetes.Object` structure and returns this as an unstructured.Unstructured object
func ToUnstructuredKubernetesObject(mp any, providerConfigRef string) (objectSpec *unstructured.Unstructured, err error) {
func ToUnstructuredKubernetesObject(mp any, providerConfigRef, deletionPolicy string) (objectSpec *unstructured.Unstructured, err error) {
objectSpec = &unstructured.Unstructured{}
var unstructuredData map[string]interface{}
if err = To(mp, &unstructuredData); err != nil {
Expand Down Expand Up @@ -78,6 +78,7 @@ func ToUnstructuredKubernetesObject(mp any, providerConfigRef string) (objectSpe
"labels": labels,
},
"spec": map[string]interface{}{
"deletionPolicy": deletionPolicy,
"forProvider": map[string]interface{}{
"manifest": unstructuredData,
},
Expand Down

0 comments on commit abbdeaf

Please sign in to comment.