Migrate to GetControllerOf from meta/v1 package

This commit is contained in:
Mikhail Mazurskiy
2017-08-02 19:41:33 +10:00
parent 5490273951
commit b28a83a4cf
30 changed files with 77 additions and 109 deletions

View File

@@ -236,7 +236,7 @@ func (rsc *ReplicaSetController) addPod(obj interface{}) {
}
// If it has a ControllerRef, that's all that matters.
if controllerRef := controller.GetControllerOf(pod); controllerRef != nil {
if controllerRef := metav1.GetControllerOf(pod); controllerRef != nil {
rs := rsc.resolveControllerRef(pod.Namespace, controllerRef)
if rs == nil {
return
@@ -292,8 +292,8 @@ func (rsc *ReplicaSetController) updatePod(old, cur interface{}) {
return
}
curControllerRef := controller.GetControllerOf(curPod)
oldControllerRef := controller.GetControllerOf(oldPod)
curControllerRef := metav1.GetControllerOf(curPod)
oldControllerRef := metav1.GetControllerOf(oldPod)
controllerRefChanged := !reflect.DeepEqual(curControllerRef, oldControllerRef)
if controllerRefChanged && oldControllerRef != nil {
// The ControllerRef was changed. Sync the old controller, if any.
@@ -362,7 +362,7 @@ func (rsc *ReplicaSetController) deletePod(obj interface{}) {
}
}
controllerRef := controller.GetControllerOf(pod)
controllerRef := metav1.GetControllerOf(pod)
if controllerRef == nil {
// No controller should care about orphans being deleted.
return