Skip to content

Commit 04231f0

Browse files
committed
rebase with main
1 parent c0d65e5 commit 04231f0

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

internal/mode/static/telemetry/collector_test.go

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -587,6 +587,31 @@ var _ = Describe("Collector", Ordered, func() {
587587
_, err := dataCollector.Collect(ctx)
588588
Expect(err).To(MatchError(expectedErr))
589589
})
590+
It("should error if the Pod's owner reference UID is empty", func() {
591+
ngfPod = &v1.Pod{
592+
ObjectMeta: metav1.ObjectMeta{
593+
Name: "pod1",
594+
OwnerReferences: []metav1.OwnerReference{
595+
{
596+
Kind: "ReplicaSet",
597+
Name: "replicaset1",
598+
},
599+
},
600+
},
601+
}
602+
603+
replicas := int32(1)
604+
ngfReplicaSet = &appsv1.ReplicaSet{
605+
Spec: appsv1.ReplicaSetSpec{
606+
Replicas: &replicas,
607+
},
608+
}
609+
k8sClientReader.GetCalls(createGetCallsFunc(ngfPod, ngfReplicaSet))
610+
611+
expectedErr := fmt.Sprintf("expected pod owner reference to have a UID: %v", ngfPod.OwnerReferences[0])
612+
_, err := dataCollector.Collect(ctx)
613+
Expect(err).To(MatchError(ContainSubstring(expectedErr)))
614+
})
590615
})
591616
})
592617
})

0 commit comments

Comments
 (0)