AddOwnerReference should always set the owner ref array to be able to modify the existing reference

Signed-off-by: Muvaffak Onus <onus.muvaffak@gmail.com>
This commit is contained in:
Muvaffak Onus 2020-04-22 23:31:04 +03:00
parent be37c50cc2
commit 48c7c448d3
No known key found for this signature in database
GPG Key ID: 86E282DC72236827
1 changed files with 1 additions and 0 deletions

View File

@ -109,6 +109,7 @@ func AddOwnerReference(o metav1.Object, r metav1.OwnerReference) {
for i := range refs {
if refs[i].UID == r.UID {
refs[i] = r
o.SetOwnerReferences(refs)
return
}
}