Skip to content

Commit 765a187

Browse files
committed
remove more readonly fields
Signed-off-by: Felix Breuer <f.breuer94@gmail.com>
1 parent bc432af commit 765a187

1 file changed

Lines changed: 16 additions & 2 deletions

File tree

pkg/ccm/loadbalancer_test.go

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,10 @@ var _ = Describe("LoadBalancer", func() {
273273
mockClient.EXPECT().UpdateLoadBalancer(
274274
gomock.Any(),
275275
loadBalancer.GetLoadBalancerName(context.Background(), clusterName, svc),
276-
versionMatcher("current-version"),
276+
gomock.All(
277+
versionMatcher("current-version"),
278+
statusNotSet(),
279+
),
277280
).MinTimes(1).Return(myLb, nil)
278281

279282
svc = svc.DeepCopy()
@@ -330,7 +333,10 @@ var _ = Describe("LoadBalancer", func() {
330333
mockClient.EXPECT().UpdateLoadBalancer(
331334
gomock.Any(),
332335
loadBalancer.GetLoadBalancerName(context.Background(), clusterName, svc),
333-
versionMatcher("current-version"),
336+
gomock.All(
337+
versionMatcher("current-version"),
338+
statusNotSet(),
339+
),
334340
).MinTimes(1).Return(myLb, nil)
335341

336342
_, err = loadBalancer.EnsureLoadBalancer(context.Background(), clusterName, svc, []*corev1.Node{nodeA, nodeB})
@@ -693,6 +699,14 @@ func versionMatcher(version string) gomock.Matcher {
693699
})
694700
}
695701

702+
// statusNotSet ensures that the given UpdateLoadBalancerPayload does not set status.
703+
func statusNotSet() gomock.Matcher {
704+
return gomock.Cond(func(x any) bool {
705+
lb := x.(*loadbalancer.UpdateLoadBalancerPayload)
706+
return lb.Status == nil
707+
})
708+
}
709+
696710
// hasNoObservabilityConfigured ensures that the given UpdateLoadBalancerPayload has no observability specified.
697711
func hasNoObservabilityConfigured() gomock.Matcher {
698712
return gomock.Cond(func(x any) bool {

0 commit comments

Comments
 (0)