Skip to content

Commit 6059412

Browse files
authored
Ensure resource is managed before deleting (#165)
Issue [#2102](aws-controllers-k8s/community#2102) By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
1 parent a6b0014 commit 6059412

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

pkg/runtime/reconciler.go

+4
Original file line numberDiff line numberDiff line change
@@ -376,6 +376,10 @@ func (r *resourceReconciler) reconcile(
376376
res acktypes.AWSResource,
377377
) (acktypes.AWSResource, error) {
378378
if res.IsBeingDeleted() {
379+
// Ensure the resource is managed before attempting delete
380+
if !r.rd.IsManaged(res) {
381+
return res, nil
382+
}
379383
// We only delete resources that are not read-only and have a deletion
380384
// policy set to delete.
381385
if r.getDeletionPolicy(res) == ackv1alpha1.DeletionPolicyDelete &&

0 commit comments

Comments
 (0)