From 0f687bbcb36db503f2df1b1372ec04ca915dbc7a Mon Sep 17 00:00:00 2001 From: Prashansa Kulshrestha Date: Mon, 22 Jul 2024 16:47:18 +0530 Subject: [PATCH] fix: Fix yaml files rendered for expression routes (#116) At the moment, when we run deck file render, all routes get `regex_priority` field. This field is not applicable in the case of expression routes. A rendered file from deck containing expression routes, thus failed to sync directly. This change ensures that expression routes do not get the fields of traditional routes. Fix #1250 --- pkg/file/builder.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/file/builder.go b/pkg/file/builder.go index 45fd940..dca2be1 100644 --- a/pkg/file/builder.go +++ b/pkg/file/builder.go @@ -1376,12 +1376,12 @@ func (b *stateBuilder) ingestRoute(r FRoute) error { // On the other hand, Konnect can support only one schema including all // fields from 'traditional' and 'expressions' router schemas. // This may be problematic when it comes to defaults injection, because - // the defaults for the 'traditiona' router schema can be wrongly injected + // the defaults for the 'traditional' router schema can be wrongly injected // into the 'expressions' route configuration. // // Here we make sure that only the fields that are supported for a given // router version are set in the route configuration. - if b.isKonnect && hasExpression && !(hasRegexPriority || hasPathHandling) { + if hasExpression && !(hasRegexPriority || hasPathHandling) { if r.Route.PathHandling != nil { r.Route.PathHandling = nil }