Skip to content

Commit b127f78

Browse files
committed
fix: r
Signed-off-by: Ashing Zheng <[email protected]>
1 parent 61f07a8 commit b127f78

File tree

5 files changed

+7
-7
lines changed

5 files changed

+7
-7
lines changed

internal/controller/apisixroute_controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ func (r *ApisixRouteReconciler) validateBackends(ctx context.Context, tc *provid
378378
subsetLabels := r.getSubsetLabels(tc, serviceNN, backend)
379379

380380
// Collect endpoints with EndpointSlice support and subset filtering
381-
if err := collectEndpointsWithEndpointSliceSupport(ctx, r.Client, tc, serviceNN, r.supportsEndpointSlice, subsetLabels); err != nil {
381+
if err := resolveServiceEndpoints(ctx, r.Client, tc, serviceNN, r.supportsEndpointSlice, subsetLabels); err != nil {
382382
return types.ReasonError{
383383
Reason: string(apiv2.ConditionReasonInvalidSpec),
384384
Message: err.Error(),

internal/controller/gatewayproxy_controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ func (r *GatewayProxyController) Reconcile(ctx context.Context, req ctrl.Request
123123
return reconcile.Result{}, err
124124
}
125125
tctx.Services[serviceNN] = service
126-
if err := collectEndpointsWithEndpointSliceSupport(tctx, r.Client, tctx, serviceNN, r.supportsEndpointSlice, nil); err != nil {
126+
if err := resolveServiceEndpoints(tctx, r.Client, tctx, serviceNN, r.supportsEndpointSlice, nil); err != nil {
127127
return reconcile.Result{}, err
128128
}
129129
}

internal/controller/httproute_controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -571,7 +571,7 @@ func (r *HTTPRouteReconciler) processHTTPRouteBackendRefs(tctx *provider.Transla
571571
tctx.Services[targetNN] = &service
572572

573573
// Collect endpoints with EndpointSlice support
574-
if err := collectEndpointsWithEndpointSliceSupport(tctx, r.Client, tctx, targetNN, r.supportsEndpointSlice, nil); err != nil {
574+
if err := resolveServiceEndpoints(tctx, r.Client, tctx, targetNN, r.supportsEndpointSlice, nil); err != nil {
575575
r.Log.Error(err, "failed to collect endpoints", "Service", targetNN)
576576
terr = err
577577
continue

internal/controller/ingress_controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -607,7 +607,7 @@ func (r *IngressReconciler) processBackendService(tctx *provider.TranslateContex
607607
}
608608

609609
// Collect endpoints with EndpointSlice support
610-
if err := collectEndpointsWithEndpointSliceSupport(tctx, r.Client, tctx, serviceNS, r.supportsEndpointSlice, nil); err != nil {
610+
if err := resolveServiceEndpoints(tctx, r.Client, tctx, serviceNS, r.supportsEndpointSlice, nil); err != nil {
611611
r.Log.Error(err, "failed to collect endpoints", "namespace", namespace, "name", backendService.Name)
612612
return err
613613
}

internal/controller/utils.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1492,7 +1492,7 @@ func addProviderEndpointsToTranslateContext(tctx *provider.TranslateContext, c c
14921492
}
14931493
tctx.Services[serviceNN] = &service
14941494

1495-
return collectEndpointsWithEndpointSliceSupport(tctx, c, tctx, serviceNN, true, nil)
1495+
return resolveServiceEndpoints(tctx, c, tctx, serviceNN, true, nil)
14961496
}
14971497

14981498
func TypePredicate[T client.Object]() func(obj client.Object) bool {
@@ -1546,9 +1546,9 @@ func watchEndpointSliceOrEndpoints(bdr *ctrl.Builder, supportsEndpointSlice bool
15461546
}
15471547
}
15481548

1549-
// collectEndpointsWithEndpointSliceSupport collects endpoints and adds them to the translate context
1549+
// resolveServiceEndpoints collects endpoints and adds them to the translate context
15501550
// It handles both EndpointSlice (K8s 1.19+) and Endpoints (K8s 1.18) APIs with automatic fallback
1551-
func collectEndpointsWithEndpointSliceSupport(
1551+
func resolveServiceEndpoints(
15521552
ctx context.Context,
15531553
c client.Client,
15541554
tctx *provider.TranslateContext,

0 commit comments

Comments
 (0)