Skip to content

Commit

Permalink
re-enable router metrics test
Browse files Browse the repository at this point in the history
  • Loading branch information
deads2k committed Dec 15, 2017
1 parent b7120a8 commit f6b0568
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
16 changes: 8 additions & 8 deletions pkg/router/metrics/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,14 +98,14 @@ func (l Listener) authorizeHandler(protected http.Handler) http.Handler {
}
scopedRecord.User = user
authorized, reason, err := l.Authorizer.Authorize(scopedRecord)
if authorized != authorizer.DecisionAllow || err != nil {
if !ok || errors.IsUnauthorized(err) {
glog.V(5).Infof("Unable to authorize: %v", err)
http.Error(w, fmt.Sprintf("Forbidden: %s", reason), http.StatusForbidden)
} else {
glog.V(3).Infof("Unable to authorize: %v", err)
http.Error(w, "Unable to authorize the user due to an error", http.StatusInternalServerError)
}
if err != nil {
glog.V(3).Infof("Unable to authorize: %v", err)
http.Error(w, "Unable to authorize the user due to an error", http.StatusInternalServerError)
return
}
if authorized != authorizer.DecisionAllow {
glog.V(5).Infof("Unable to authorize: %v", err)
http.Error(w, fmt.Sprintf("Forbidden: %s", reason), http.StatusForbidden)
return
}
protected.ServeHTTP(w, req)
Expand Down
3 changes: 0 additions & 3 deletions test/extended/util/test.go
Original file line number Diff line number Diff line change
Expand Up @@ -260,9 +260,6 @@ var (
// these broke in the rebase, but everything else is working
`should function for intra-pod communication`,
`should function for node-pod communication`,
// consistent 500 errors
"should expose prometheus metrics for a route",
"should expose the profiling endpoints",

`\[Skipped\]`,
`\[Slow\]`,
Expand Down

0 comments on commit f6b0568

Please sign in to comment.