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

@@ -579,7 +579,7 @@ func ListReplicaSets(deployment *extensions.Deployment, getRSList RsListFunc) ([
// Only include those whose ControllerRef matches the Deployment.
owned := make([]*extensions.ReplicaSet, 0, len(all))
for _, rs := range all {
controllerRef := controller.GetControllerOf(rs)
controllerRef := metav1.GetControllerOf(rs)
if controllerRef != nil && controllerRef.UID == deployment.UID {
owned = append(owned, rs)
}
@@ -603,7 +603,7 @@ func ListReplicaSetsInternal(deployment *internalextensions.Deployment, getRSLis
// Only include those whose ControllerRef matches the Deployment.
filtered := make([]*internalextensions.ReplicaSet, 0, len(all))
for _, rs := range all {
controllerRef := controller.GetControllerOf(rs)
controllerRef := metav1.GetControllerOf(rs)
if controllerRef != nil && controllerRef.UID == deployment.UID {
filtered = append(filtered, rs)
}
@@ -637,7 +637,7 @@ func ListPods(deployment *extensions.Deployment, rsList []*extensions.ReplicaSet
owned := &v1.PodList{Items: make([]v1.Pod, 0, len(all.Items))}
for i := range all.Items {
pod := &all.Items[i]
controllerRef := controller.GetControllerOf(pod)
controllerRef := metav1.GetControllerOf(pod)
if controllerRef != nil && rsMap[controllerRef.UID] {
owned.Items = append(owned.Items, *pod)
}