Skip to content

Commit

Permalink
address reviews' comments
Browse files Browse the repository at this point in the history
Signed-off-by: Mattia Lavacca <[email protected]>
  • Loading branch information
mlavacca committed Oct 30, 2023
1 parent f5bd975 commit de893ab
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion pkg/i2gw/providers/common/converter.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{},
Expand Down
2 changes: 1 addition & 1 deletion pkg/i2gw/providers/common/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/i2gw/providers/ingressnginx/canary.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
2 changes: 1 addition & 1 deletion pkg/i2gw/providers/kong/header_matching.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
2 changes: 1 addition & 1 deletion pkg/i2gw/providers/kong/method_matching.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
2 changes: 1 addition & 1 deletion pkg/i2gw/providers/kong/plugins.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit de893ab

Please sign in to comment.