Migrate to IsControlledBy from meta/v1 package

This commit is contained in:
Mikhail Mazurskiy
2017-08-02 20:36:58 +10:00
parent 042b5642b9
commit 32b78aebf2
5 changed files with 13 additions and 17 deletions

View File

@@ -1068,7 +1068,7 @@ func (dsc *DaemonSetsController) simulate(newPod *v1.Pod, node *v1.Node, ds *ext
}
// ignore pods that belong to the daemonset when taking into account whether
// a daemonset should bind to a node.
if controllerRef := metav1.GetControllerOf(pod); controllerRef != nil && controllerRef.UID == ds.UID {
if metav1.IsControlledBy(pod, ds) {
continue
}
pods = append(pods, pod)