Skip to content

Commit e5e8f48

Browse files
committed
options moved to converter.
Signed-off-by: Mattia Lavacca <[email protected]>
1 parent 08daf0c commit e5e8f48

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

pkg/i2gw/providers/common/converter.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@ func toHTTPRouteMatch(routePath networkingv1.HTTPIngressPath, path *field.Path,
365365
if toImplementationSpecificPathMatch != nil {
366366
toImplementationSpecificPathMatch(match.Path)
367367
} else {
368-
return nil, field.Invalid(path.Child("pathType"), routePath.PathType, fmt.Sprintf("unsupported path match type: %s", *routePath.PathType))
368+
return nil, field.Invalid(path.Child("pathType"), routePath.PathType, fmt.Sprintf("implementationSpecific path type is not supported in generic translation, and your provider does not provide custom support to translate it: %s", *routePath.PathType))
369369
}
370370
}
371371

pkg/i2gw/providers/kong/converter.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ import (
2626
type converter struct {
2727
conf *i2gw.ProviderConf
2828

29-
featureParsers []i2gw.FeatureParser
29+
featureParsers []i2gw.FeatureParser
30+
ImplementationSpecificOptions i2gw.ProviderImplementationSpecificOptions
3031
}
3132

3233
// newConverter returns an kong converter instance.
@@ -38,6 +39,9 @@ func newConverter(conf *i2gw.ProviderConf) *converter {
3839
methodMatchingFeature,
3940
pluginsFeature,
4041
},
42+
ImplementationSpecificOptions: i2gw.ProviderImplementationSpecificOptions{
43+
ToImplementationSpecificHTTPPathMatch: implementationSpecificHTTPPathMatch,
44+
},
4145
}
4246
}
4347

@@ -47,9 +51,7 @@ func (c *converter) ToGatewayAPI(resources i2gw.InputResources) (i2gw.GatewayRes
4751

4852
// Convert plain ingress resources to gateway resources, ignoring all
4953
// provider-specific features.
50-
gatewayResources, errs := common.ToGateway(resources.Ingresses, i2gw.ProviderImplementationSpecificOptions{
51-
ToImplementationSpecificHTTPPathMatch: implementationSpecificHTTPPathMatch,
52-
})
54+
gatewayResources, errs := common.ToGateway(resources.Ingresses, c.ImplementationSpecificOptions)
5355
if len(errs) > 0 {
5456
return i2gw.GatewayResources{}, errs
5557
}

0 commit comments

Comments
 (0)