Skip to content

Commit

Permalink
Merge pull request #38 from gerald1248/path_based_routing
Browse files Browse the repository at this point in the history
fixed false positives for path-based routing
  • Loading branch information
gerald1248 authored Feb 21, 2017
2 parents 7fce1ca + c976b64 commit c1605c0
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 8 deletions.
8 changes: 4 additions & 4 deletions bindata.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions item-route-conflict.go → item-route.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ func (irc *ItemRouteConflict) Lint(config *Config, params LinterParams) (ResultM

namespace := item.Metadata.Namespace

key = item.Spec.Host
key = item.Spec.Host + item.Spec.Path
value = item.Metadata.Name

if len(routeMap[key]) > 0 && routeMap[key] != value {
problem := fmt.Sprintf("Route to host '%s' defined twice: '%s' and '%s'", routeMap[key], value, key)
problem := fmt.Sprintf("Route to '%s' defined twice: '%s' and '%s'", key, routeMap[key], value)
if len(namespace) > 0 {
problem += fmt.Sprintf(" (namespace '%s')", namespace)
}
Expand Down
2 changes: 0 additions & 2 deletions postprocess.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package main

import (
"fmt"
"regexp"
)

Expand Down Expand Up @@ -29,7 +28,6 @@ func postprocessResult(r *ResultMap, params LinterParams) error {

if re.FindStringIndex(spec.Container) != nil {
replace = true
fmt.Printf("Skipping %s\n", container)
} else {
s = append(s, spec)
}
Expand Down
1 change: 1 addition & 0 deletions types.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ type Spec struct {

//Route
Host string `json:"host"`
Path string `json:"path"`
Port *Port `json:"port"`
}

Expand Down

0 comments on commit c1605c0

Please sign in to comment.