Skip to content

Commit

Permalink
add reason to cached obj
Browse files Browse the repository at this point in the history
  • Loading branch information
jinja2 committed Dec 16, 2024
1 parent 5ead747 commit 41040d4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions receiver/k8sclusterreceiver/internal/pod/pods.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ func Transform(pod *corev1.Pod) *corev1.Pod {
Status: corev1.PodStatus{
Phase: pod.Status.Phase,
QOSClass: pod.Status.QOSClass,
Reason: pod.Status.Reason,
},
}
for _, cs := range pod.Status.ContainerStatuses {
Expand Down
4 changes: 3 additions & 1 deletion receiver/k8sclusterreceiver/internal/pod/pods_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,7 @@ func TestTransform(t *testing.T) {
},
Status: corev1.PodStatus{
Phase: corev1.PodRunning,
Reason: "Evicted",
HostIP: "192.168.1.100",
PodIP: "10.244.0.5",
StartTime: &v1.Time{Time: v1.Now().Add(-5 * time.Minute)},
Expand Down Expand Up @@ -464,7 +465,8 @@ func TestTransform(t *testing.T) {
},
},
Status: corev1.PodStatus{
Phase: corev1.PodRunning,
Phase: corev1.PodRunning,
Reason: "Evicted",
ContainerStatuses: []corev1.ContainerStatus{
{
Name: "my-container",
Expand Down

0 comments on commit 41040d4

Please sign in to comment.