Skip to content

Commit 04584e9

Browse files
committed
resolve comments
1 parent 9c2c810 commit 04584e9

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

internal/controller/apisixroute_controller.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -694,8 +694,9 @@ func (r *ApisixRouteReconciler) listApisixRoutesForPluginConfig(ctx context.Cont
694694
}
695695

696696
func (r *ApisixRouteReconciler) getSubsetLabels(ctx context.Context, ar *apiv2.ApisixRoute, backend apiv2.ApisixRouteHTTPBackend) (map[string]string, error) {
697+
empty := make(map[string]string)
697698
if backend.Subset == "" {
698-
return make(map[string]string), nil
699+
return empty, nil
699700
}
700701

701702
// Try to Get the ApisixUpstream with the same name as backend.ServiceName
@@ -708,7 +709,7 @@ func (r *ApisixRouteReconciler) getSubsetLabels(ctx context.Context, ar *apiv2.A
708709
)
709710
if err := r.Get(ctx, auNN, &au); err != nil {
710711
if client.IgnoreNotFound(err) == nil {
711-
return make(map[string]string), nil
712+
return empty, nil
712713
}
713714
return nil, err
714715
}
@@ -720,7 +721,7 @@ func (r *ApisixRouteReconciler) getSubsetLabels(ctx context.Context, ar *apiv2.A
720721
}
721722
}
722723

723-
return make(map[string]string), nil
724+
return empty, nil
724725
}
725726

726727
func (r *ApisixRouteReconciler) filterEndpointSlicesBySubsetLabels(ctx context.Context, in []discoveryv1.EndpointSlice, labels map[string]string) []discoveryv1.EndpointSlice {

internal/provider/adc/translator/apisixupstream.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ func translateApisixUpstreamClientTLS(tctx *provider.TranslateContext, au *apiv2
146146
)
147147
secret, ok := tctx.Secrets[secretNN]
148148
if !ok {
149-
return nil
149+
return errors.Errorf("sercret %s not found", secretNN)
150150
}
151151

152152
cert, key, err := extractKeyPair(secret, true)

0 commit comments

Comments
 (0)