From 4f06928beed0e558932440060c4a9e87db552d68 Mon Sep 17 00:00:00 2001 From: Jamo Luhrsen Date: Mon, 1 Jul 2024 16:16:53 -0700 Subject: [PATCH] use setStatus() instead of set() there was an update [0] to the controller-runtime fake client to zero out all fields when serializing a target this was causing the UpdatedReplicas value to be overwritten with 0 and causing the UT to fail. the test case portion affected by this was only interested in Status changes so updating to use setStatus() should make sense here. [0] https://github.com/kubernetes-sigs/controller-runtime/commit/e36814913e653c03771e57349cd5fb257ef96eda Signed-off-by: Jamo Luhrsen --- pkg/controller/statusmanager/status_manager_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/controller/statusmanager/status_manager_test.go b/pkg/controller/statusmanager/status_manager_test.go index 14af0adb40..b2f42af845 100644 --- a/pkg/controller/statusmanager/status_manager_test.go +++ b/pkg/controller/statusmanager/status_manager_test.go @@ -1280,7 +1280,7 @@ func TestStatusManagerSetFromDeployments(t *testing.T) { depB.Status.UpdatedReplicas = depB.Status.Replicas depB.Status.UnavailableReplicas = 0 depB.Status.AvailableReplicas = depB.Status.Replicas - set(t, client, depB) + setStatus(t, client, depB) status.SetFromPods() co, oc, err = getStatuses(client, "testing")