Skip to content

Commit b1707d1

Browse files
committed
fix: Allow deleting orphans while retaining the data
check for DeleteCustomResourceOnly label in orphan when deciding whether to clean the data associated ref#11286 Signed-off-by: Nina Zhan <[email protected]>
1 parent ed5c43f commit b1707d1

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

controller/orphan_controller.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -623,6 +623,10 @@ func (oc *OrphanController) updateDataCleanableCondition(orphan *longhorn.Orphan
623623
reason = oc.checkOrphanedReplicaDataCleanable(node, orphan)
624624
}
625625

626+
if orphan.Labels[types.DeleteCustomResourceOnly] == "true" {
627+
reason = longhorn.OrphanConditionTypeDataCleanableReasonSkipped
628+
}
629+
626630
return nil
627631
}
628632

0 commit comments

Comments
 (0)