Skip to content

Commit

Permalink
fix: for changing pathType between 'Exact' and 'Prefix' (#262)
Browse files Browse the repository at this point in the history
fix: for chaning pathType between 'Exact' and 'Prefix'
  • Loading branch information
jonstacks authored Jun 28, 2023
1 parent 8bc2331 commit d761c1d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions internal/controllers/httpsedge_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -384,10 +384,12 @@ func (r *HTTPSEdgeReconciler) updateStatus(ctx context.Context, edge *ingressv1a
}

// getMatchingRouteFromEdgeStatus returns the route status for the given ingressv1alpha1.HTTPSEdgeRouteSpec. If there is
// no match in the ingressv1alpha1.HTTPSEdge.Status.Routes, then nil is returned.
// no match in the ingressv1alpha1.HTTPSEdge.Status.Routes, then nil is returned. In the Ingress Spec, we can have both
// a Prefix and Exact match for the same path. In ngrok, Route match expressions must be unique across all routes for the
// edge. So we match on just the Match field and ignore the MatchType field.
func (r *HTTPSEdgeReconciler) getMatchingRouteFromEdgeStatus(edge *ingressv1alpha1.HTTPSEdge, route ingressv1alpha1.HTTPSEdgeRouteSpec) *ingressv1alpha1.HTTPSEdgeRouteStatus {
for _, routeStatus := range edge.Status.Routes {
if route.MatchType == routeStatus.MatchType && route.Match == routeStatus.Match {
if route.Match == routeStatus.Match {
return &routeStatus
}
}
Expand Down

0 comments on commit d761c1d

Please sign in to comment.