Skip to content

Commit

Permalink
use setStatus() instead of set()
Browse files Browse the repository at this point in the history
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] kubernetes-sigs/controller-runtime@e368149

Signed-off-by: Jamo Luhrsen <jluhrsen@gmail.com>
  • Loading branch information
jluhrsen committed Jul 1, 2024
1 parent 48ee7cc commit 4f06928
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/controller/statusmanager/status_manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit 4f06928

Please sign in to comment.