Skip to content

Commit

Permalink
Don't block deletion of owner by default (#343)
Browse files Browse the repository at this point in the history
To block deletion of synchronous GC of owner, delete permission on owner is required. We generally do want to want to require delete permision on owner. For background, check here: https://github.com/kubernetes/community/blob/master/contributors/design-proposals/api-machinery/synchronous-garbage-collection.md#ownerreference
  • Loading branch information
tamalsaha authored Feb 20, 2018
1 parent 4b00589 commit 1f27420
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/util/kubernetes.go
Original file line number Diff line number Diff line change
Expand Up @@ -588,6 +588,8 @@ func EnsureOwnerReference(meta metav1.ObjectMeta, owner *core.ObjectReference) m
meta.OwnerReferences[fi].Kind = owner.Kind
meta.OwnerReferences[fi].Name = owner.Name
meta.OwnerReferences[fi].UID = owner.UID
meta.OwnerReferences[fi].BlockOwnerDeletion = types.TrueP()
if meta.OwnerReferences[fi].BlockOwnerDeletion == nil {
meta.OwnerReferences[fi].BlockOwnerDeletion = types.FalseP()
}
return meta
}

0 comments on commit 1f27420

Please sign in to comment.