From 8216d4a727d43138e7314e571c1b19e45209abf8 Mon Sep 17 00:00:00 2001 From: Timofey Titovets Date: Mon, 4 Dec 2023 22:02:32 +0100 Subject: [PATCH] chore: status_test.go check pod labels & terminating status Signed-off-by: Timofey Titovets --- internal/ingress/status/status_test.go | 42 ++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/internal/ingress/status/status_test.go b/internal/ingress/status/status_test.go index 01419708b..d3fbb9406 100644 --- a/internal/ingress/status/status_test.go +++ b/internal/ingress/status/status_test.go @@ -101,6 +101,31 @@ func buildSimpleClientSet() *testclient.Clientset { }, }, }, + { + ObjectMeta: metav1.ObjectMeta{ + Name: "foo_terminating", + Namespace: metav1.NamespaceDefault, + Labels: map[string]string{ + "label_sig": "foo_pod", + "app.kubernetes.io/version": "x.x.x", + "pod-template-hash": "hash-value", + "controller-revision-hash": "deadbeef", + }, + DeletionTimestamp: &metav1.Time{}, + }, + Spec: apiv1.PodSpec{ + NodeName: "foo_node_3", + }, + Status: apiv1.PodStatus{ + Phase: apiv1.PodRunning, + Conditions: []apiv1.PodCondition{ + { + Type: apiv1.PodReady, + Status: apiv1.ConditionTrue, + }, + }, + }, + }, { ObjectMeta: metav1.ObjectMeta{ Name: "foo3", @@ -168,6 +193,23 @@ func buildSimpleClientSet() *testclient.Clientset { }, }, }, + { + ObjectMeta: metav1.ObjectMeta{ + Name: "foo_node_3", + }, + Status: apiv1.NodeStatus{ + Addresses: []apiv1.NodeAddress{ + { + Type: apiv1.NodeInternalIP, + Address: "12.0.0.1", + }, + { + Type: apiv1.NodeExternalIP, + Address: "12.0.0.2", + }, + }, + }, + }, }}, &apiv1.EndpointsList{Items: []apiv1.Endpoints{ {