Skip to content

Commit

Permalink
SUper deletion protection
Browse files Browse the repository at this point in the history
  • Loading branch information
Gabriel Saratura committed Feb 10, 2025
1 parent 347537c commit 4107e59
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions pkg/controller/webhooks/deletionprotection.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,13 +104,7 @@ func checkManagedObject(ctx context.Context, obj client.Object, c client.Client,
return compositeInfo{Exists: true, Name: ownerName}, fmt.Errorf("cannot get composite: %w", err)
}

// Check if the composite is already being deleted, then we disengage the
// protection.
if comp.GetDeletionTimestamp() != nil {
return compositeInfo{Exists: false, Name: ownerName}, nil
}

return compositeInfo{Exists: isDeletionProtected(obj), Name: ownerName}, nil
return compositeInfo{Exists: true, Name: ownerName}, nil
}

// checkUnmanagedObject tries to get the composite information about objects that are not directly managed by Crossplane.
Expand Down

0 comments on commit 4107e59

Please sign in to comment.