diff --git a/pkg/i2gw/providers/common/converter.go b/pkg/i2gw/providers/common/converter.go index 7038bc7d..6ce814ee 100644 --- a/pkg/i2gw/providers/common/converter.go +++ b/pkg/i2gw/providers/common/converter.go @@ -283,7 +283,7 @@ func (rg *ingressRuleGroup) toHTTPRoute() (gatewayv1beta1.HTTPRoute, field.Error httpRoute := gatewayv1beta1.HTTPRoute{ ObjectMeta: metav1.ObjectMeta{ - Name: HTTPRouteName(rg.name, rg.host), + Name: RouteName(rg.name, rg.host), Namespace: rg.namespace, }, Spec: gatewayv1beta1.HTTPRouteSpec{}, diff --git a/pkg/i2gw/providers/common/utils.go b/pkg/i2gw/providers/common/utils.go index 880aa78e..ef472fec 100644 --- a/pkg/i2gw/providers/common/utils.go +++ b/pkg/i2gw/providers/common/utils.go @@ -101,7 +101,7 @@ func NameFromHost(host string) string { return step2 } -func HTTPRouteName(ingressName, host string) string { +func RouteName(ingressName, host string) string { return fmt.Sprintf("%s-%s", ingressName, NameFromHost(host)) } diff --git a/pkg/i2gw/providers/ingressnginx/canary.go b/pkg/i2gw/providers/ingressnginx/canary.go index c4a0268e..4c74c82e 100644 --- a/pkg/i2gw/providers/ingressnginx/canary.go +++ b/pkg/i2gw/providers/ingressnginx/canary.go @@ -44,7 +44,7 @@ func canaryFeature(ingressResources i2gw.InputResources, gatewayResources *i2gw. backendRefs, calculationErrs := calculateBackendRefWeight(paths) errs = append(errs, calculationErrs...) - key := types.NamespacedName{Namespace: path.ingress.Namespace, Name: common.HTTPRouteName(rg.Name, rg.Host)} + key := types.NamespacedName{Namespace: path.ingress.Namespace, Name: common.RouteName(rg.Name, rg.Host)} httpRoute, ok := gatewayResources.HTTPRoutes[key] if !ok { panic("HTTPRoute not exists - this should never happen") diff --git a/pkg/i2gw/providers/kong/header_matching.go b/pkg/i2gw/providers/kong/header_matching.go index 8f49ca65..c7a404bd 100644 --- a/pkg/i2gw/providers/kong/header_matching.go +++ b/pkg/i2gw/providers/kong/header_matching.go @@ -41,7 +41,7 @@ func headerMatchingFeature(ingressResources i2gw.InputResources, gatewayResource for _, rg := range ruleGroups { for _, rule := range rg.Rules { headerskeys, headersValues := parseHeadersAnnotations(rule.Ingress.Annotations) - key := types.NamespacedName{Namespace: rule.Ingress.Namespace, Name: common.HTTPRouteName(rg.Name, rg.Host)} + key := types.NamespacedName{Namespace: rule.Ingress.Namespace, Name: common.RouteName(rg.Name, rg.Host)} httpRoute, ok := gatewayResources.HTTPRoutes[key] if !ok { panic("HTTPRoute does not exist - this should never happen") diff --git a/pkg/i2gw/providers/kong/method_matching.go b/pkg/i2gw/providers/kong/method_matching.go index ecb630de..cf4544a7 100644 --- a/pkg/i2gw/providers/kong/method_matching.go +++ b/pkg/i2gw/providers/kong/method_matching.go @@ -39,7 +39,7 @@ func methodMatchingFeature(ingressResources i2gw.InputResources, gatewayResource ruleGroups := common.GetRuleGroups(ingressResources.Ingresses) for _, rg := range ruleGroups { for _, rule := range rg.Rules { - key := types.NamespacedName{Namespace: rule.Ingress.Namespace, Name: common.HTTPRouteName(rg.Name, rg.Host)} + key := types.NamespacedName{Namespace: rule.Ingress.Namespace, Name: common.RouteName(rg.Name, rg.Host)} httpRoute, ok := gatewayResources.HTTPRoutes[key] if !ok { panic("HTTPRoute does not exist - this should never happen") diff --git a/pkg/i2gw/providers/kong/plugins.go b/pkg/i2gw/providers/kong/plugins.go index cb4d8de3..25db2efe 100644 --- a/pkg/i2gw/providers/kong/plugins.go +++ b/pkg/i2gw/providers/kong/plugins.go @@ -41,7 +41,7 @@ func pluginsFeature(ingressResources i2gw.InputResources, gatewayResources *i2gw ruleGroups := common.GetRuleGroups(ingressResources.Ingresses) for _, rg := range ruleGroups { for _, rule := range rg.Rules { - key := types.NamespacedName{Namespace: rule.Ingress.Namespace, Name: common.NameFromHost(rg.Host)} + key := types.NamespacedName{Namespace: rule.Ingress.Namespace, Name: common.RouteName(rg.Name, rg.Host)} httpRoute, ok := gatewayResources.HTTPRoutes[key] if !ok { panic("HTTPRoute does not exist - this should never happen")