diff --git a/controllers/rate_limiting_wasmplugin_controller.go b/controllers/rate_limiting_wasmplugin_controller.go index c3d87ed19..2e6b2c7be 100644 --- a/controllers/rate_limiting_wasmplugin_controller.go +++ b/controllers/rate_limiting_wasmplugin_controller.go @@ -174,7 +174,7 @@ func (r *RateLimitingWASMPluginReconciler) wasmPluginConfig(ctx context.Context, for _, policy := range rateLimitPolicies { rlp := policy.(*kuadrantv1beta2.RateLimitPolicy) - wasmRLP, err := r.WASMRateLimitPolicy(ctx, t, rlp, gw) + wasmRLP, err := r.wasmRateLimitPolicy(ctx, t, rlp, gw) if err != nil { return nil, err } @@ -232,8 +232,8 @@ func (r *RateLimitingWASMPluginReconciler) topologyIndexesFromGateway(ctx contex return kuadrantgatewayapi.NewTopologyIndexes(t), nil } -func (r *RateLimitingWASMPluginReconciler) WASMRateLimitPolicy(ctx context.Context, t *kuadrantgatewayapi.TopologyIndexes, rlp *kuadrantv1beta2.RateLimitPolicy, gw *gatewayapiv1.Gateway) (*wasm.RateLimitPolicy, error) { - route, err := r.RouteFromRLP(ctx, t, rlp, gw) +func (r *RateLimitingWASMPluginReconciler) wasmRateLimitPolicy(ctx context.Context, t *kuadrantgatewayapi.TopologyIndexes, rlp *kuadrantv1beta2.RateLimitPolicy, gw *gatewayapiv1.Gateway) (*wasm.RateLimitPolicy, error) { + route, err := r.routeFromRLP(ctx, t, rlp, gw) if err != nil { return nil, err } @@ -280,7 +280,7 @@ func (r *RateLimitingWASMPluginReconciler) WASMRateLimitPolicy(ctx context.Conte }, nil } -func (r *RateLimitingWASMPluginReconciler) RouteFromRLP(ctx context.Context, t *kuadrantgatewayapi.TopologyIndexes, rlp *kuadrantv1beta2.RateLimitPolicy, gw *gatewayapiv1.Gateway) (*gatewayapiv1.HTTPRoute, error) { +func (r *RateLimitingWASMPluginReconciler) routeFromRLP(ctx context.Context, t *kuadrantgatewayapi.TopologyIndexes, rlp *kuadrantv1beta2.RateLimitPolicy, gw *gatewayapiv1.Gateway) (*gatewayapiv1.HTTPRoute, error) { logger, err := logr.FromContext(ctx) if err != nil { return nil, err @@ -321,7 +321,7 @@ func (r *RateLimitingWASMPluginReconciler) RouteFromRLP(ctx context.Context, t * } // addHTTPRouteByGatewayIndexer declares an index key that we can later use with the client as a pseudo-field name, -// allowing to query all the routes parenting a given gateway +// allowing to query all the routes parented by a given gateway // to prevent creating the same index field multiple times, the function is declared private to be // called only by this controller func addHTTPRouteByGatewayIndexer(mgr ctrl.Manager, baseLogger logr.Logger) error { diff --git a/controllers/rate_limiting_wasmplugin_controller_test.go b/controllers/rate_limiting_wasmplugin_controller_test.go index 1ceeffd5e..e0500d9a5 100644 --- a/controllers/rate_limiting_wasmplugin_controller_test.go +++ b/controllers/rate_limiting_wasmplugin_controller_test.go @@ -354,7 +354,7 @@ var _ = Describe("Rate Limiting WasmPlugin controller", func() { Expect(wasmRLP.Service).To(Equal(common.KuadrantRateLimitClusterName)) }) - It("Simple RLP targeting Gateway parenting one HTTPRoute creates wasmplugin", func() { + It("Simple RLP targeting Gateway parented by one HTTPRoute creates wasmplugin", func() { // create httproute httpRoute := testBuildBasicHttpRoute(routeName, gwName, testNamespace, []string{"*.example.com"}) err := k8sClient.Create(context.Background(), httpRoute) @@ -947,7 +947,7 @@ var _ = Describe("Rate Limiting WasmPlugin controller", func() { }) // Check wasm plugin for gateway B does not exist - // There is not RLP targeting Gateway B or any route parenting Gateway B + // There is not RLP targeting Gateway B or any route parented by Gateway B // it may take some reconciliation loops to get to that, so checking it with eventually Eventually(func() bool { wasmPluginKey := client.ObjectKey{Name: rlptools.WASMPluginName(gwB), Namespace: testNamespace}