Skip to content

Commit

Permalink
pkg/metrics: Use method to get ownerRef
Browse files Browse the repository at this point in the history
  • Loading branch information
lilic committed Feb 15, 2019
1 parent eec9bfa commit 34954b3
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions pkg/metrics/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,14 +147,7 @@ func getPodOwnerRef(ctx context.Context, client crclient.Client, ns string) (*me
if err != nil {
return nil, err
}
podOwnerRefs := &metav1.OwnerReference{
APIVersion: "core/v1",
Kind: "Pod",
Name: pod.Name,
UID: pod.UID,
Controller: &trueVar,
}

podOwnerRefs := metav1.NewControllerRef(pod, pod.GroupVersionKind()
// Get Owner that the Pod belongs to
ownerRef := metav1.GetControllerOf(pod)
finalOwnerRef, err := findFinalOwnerRef(ctx, client, ns, ownerRef)
Expand Down

0 comments on commit 34954b3

Please sign in to comment.