Skip to content

Commit 938359d

Browse files
committed
Revert "Fix RemoveOwnerRef so that it does not mutate its input"
This reverts commit da5da78bf6f972e7cc2dc1f10f750a8df65df8a9.
1 parent 9248fea commit 938359d

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

util/util.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -326,8 +326,7 @@ func ReplaceOwnerRef(ownerReferences []metav1.OwnerReference, source metav1.Obje
326326
// RemoveOwnerRef returns the slice of owner references after removing the supplied owner ref.
327327
func RemoveOwnerRef(ownerReferences []metav1.OwnerReference, inputRef metav1.OwnerReference) []metav1.OwnerReference {
328328
if index := indexOwnerRef(ownerReferences, inputRef); index != -1 {
329-
copyOwnerReferences := append([]metav1.OwnerReference{}, ownerReferences...)
330-
return append(copyOwnerReferences[:index], copyOwnerReferences[index+1:]...)
329+
return append(ownerReferences[:index], ownerReferences[index+1:]...)
331330
}
332331
return ownerReferences
333332
}

0 commit comments

Comments
 (0)