Skip to content

Commit

Permalink
fix: Fix yaml files rendered for expression routes (#116)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Prashansa-K authored Jul 22, 2024
1 parent b601d2f commit 0f687bb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/file/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 0f687bb

Please sign in to comment.