Skip to content

Commit 983320a

Browse files
committed
fix: init cache include CLBNodeBinding
Signed-off-by: roc <[email protected]>
1 parent c134c36 commit 983320a

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

cmd/app/setup_manager.go

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,19 @@ func (i *initCache) Start(ctx context.Context) error {
8383
return err
8484
}
8585
for _, pb := range pbl.Items {
86-
for _, podBinding := range pb.Status.PortBindings {
87-
if err := portpool.Allocator.MarkAllocated(podBinding.Pool, podBinding.LoadbalancerId, podBinding.LoadbalancerPort, podBinding.LoadbalancerEndPort, podBinding.Protocol); err != nil {
86+
for _, bd := range pb.Status.PortBindings {
87+
if err := portpool.Allocator.MarkAllocated(bd.Pool, bd.LoadbalancerId, bd.LoadbalancerPort, bd.LoadbalancerEndPort, bd.Protocol); err != nil {
88+
return err
89+
}
90+
}
91+
}
92+
npbl := &networkingv1alpha1.CLBNodeBindingList{}
93+
if err := i.List(ctx, npbl); err != nil {
94+
return err
95+
}
96+
for _, pb := range npbl.Items {
97+
for _, bd := range pb.Status.PortBindings {
98+
if err := portpool.Allocator.MarkAllocated(bd.Pool, bd.LoadbalancerId, bd.LoadbalancerPort, bd.LoadbalancerEndPort, bd.Protocol); err != nil {
8899
return err
89100
}
90101
}

0 commit comments

Comments
 (0)