MCPcopy Create free account
hub / github.com/zalando/skipper / processTreePredicates

Function processTreePredicates

routing/datasource.go:462–490  ·  view source on GitHub ↗

processes path tree relevant predicates

(r *Route, predicateList []*eskip.Predicate)

Source from the content-addressed store, hash-verified

460
461// processes path tree relevant predicates
462func processTreePredicates(r *Route, predicateList []*eskip.Predicate) error {
463 // backwards compatibility
464 if r.Path != "" {
465 predicateList = append(predicateList, &eskip.Predicate{Name: predicates.PathName, Args: []interface{}{r.Path}})
466 }
467
468 if !validTreePredicates(predicateList) {
469 return fmt.Errorf("multiple tree predicates (Path, PathSubtree) in the route: %s", r.Id)
470 }
471
472 for _, p := range predicateList {
473 switch p.Name {
474 case predicates.PathName:
475 path, err := processPathOrSubTree(p)
476 if err != nil {
477 return err
478 }
479 r.path = path
480 case predicates.PathSubtreeName:
481 pst, err := processPathOrSubTree(p)
482 if err != nil {
483 return err
484 }
485 r.pathSubtree = pst
486 }
487 }
488
489 return nil
490}
491
492// ValidateRoute processes a route definition through all configured preprocessors
493// and validates that all resulting routes can be successfully processed.

Callers 1

processRouteDefFunction · 0.85

Calls 3

validTreePredicatesFunction · 0.85
processPathOrSubTreeFunction · 0.85
ErrorfMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…