Skip to content

Commit 3c6d6a2

Browse files
authored
fix auto-orphaning logic (#414)
1 parent c1f5607 commit 3c6d6a2

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

pkg/reconciler/reconciler.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1366,9 +1366,11 @@ func (r *Reconciler) orphanObject(ctx context.Context, existingObject *unstructu
13661366
}
13671367

13681368
if existingObject.GetLabels()[r.labelKeyOwnerId] != hashedOwnerId {
1369-
return fmt.Errorf("owner conflict; object %s has no or different owner", types.ObjectKeyToString(existingObject))
1369+
// the object has a different owner; so we do not raise an owner id conflict error here
1370+
return nil
13701371
}
13711372

1373+
// do cleanup on orphaned object; note: this happens only if we own it; otherwise we already returned above
13721374
if isCrd(existingObject) || isApiService(existingObject) {
13731375
object := existingObject.DeepCopy()
13741376
if controllerutil.RemoveFinalizer(object, r.finalizer) {

0 commit comments

Comments
 (0)