DaemonSet: Always set BlockOwnerDeletion in ControllerRef.

pull/6/head
Anthony Yeh 2017-03-02 10:39:52 -08:00
parent ab5a82d6e6
commit 97c363a3e0
1 changed files with 7 additions and 5 deletions

View File

@ -976,13 +976,15 @@ func Predicates(pod *v1.Pod, nodeInfo *schedulercache.NodeInfo) (bool, []algorit
// newControllerRef creates a ControllerRef pointing to the given DaemonSet. // newControllerRef creates a ControllerRef pointing to the given DaemonSet.
func newControllerRef(ds *extensions.DaemonSet) *metav1.OwnerReference { func newControllerRef(ds *extensions.DaemonSet) *metav1.OwnerReference {
blockOwnerDeletion := true
isController := true isController := true
return &metav1.OwnerReference{ return &metav1.OwnerReference{
APIVersion: controllerKind.GroupVersion().String(), APIVersion: controllerKind.GroupVersion().String(),
Kind: controllerKind.Kind, Kind: controllerKind.Kind,
Name: ds.Name, Name: ds.Name,
UID: ds.UID, UID: ds.UID,
Controller: &isController, BlockOwnerDeletion: &blockOwnerDeletion,
Controller: &isController,
} }
} }