Skip to content

Commit 02c5991

Browse files
committed
re-enable router metrics test
1 parent d3cdfec commit 02c5991

File tree

2 files changed

+8
-11
lines changed

2 files changed

+8
-11
lines changed

pkg/router/metrics/metrics.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -98,14 +98,14 @@ func (l Listener) authorizeHandler(protected http.Handler) http.Handler {
9898
}
9999
scopedRecord.User = user
100100
authorized, reason, err := l.Authorizer.Authorize(scopedRecord)
101-
if authorized != authorizer.DecisionAllow || err != nil {
102-
if !ok || errors.IsUnauthorized(err) {
103-
glog.V(5).Infof("Unable to authorize: %v", err)
104-
http.Error(w, fmt.Sprintf("Forbidden: %s", reason), http.StatusForbidden)
105-
} else {
106-
glog.V(3).Infof("Unable to authorize: %v", err)
107-
http.Error(w, "Unable to authorize the user due to an error", http.StatusInternalServerError)
108-
}
101+
if err != nil {
102+
glog.V(3).Infof("Unable to authorize: %v", err)
103+
http.Error(w, "Unable to authorize the user due to an error", http.StatusInternalServerError)
104+
return
105+
}
106+
if authorized != authorizer.DecisionAllow {
107+
glog.V(5).Infof("Unable to authorize: %v", err)
108+
http.Error(w, fmt.Sprintf("Forbidden: %s", reason), http.StatusForbidden)
109109
return
110110
}
111111
protected.ServeHTTP(w, req)

test/extended/util/test.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -260,9 +260,6 @@ var (
260260
// these broke in the rebase, but everything else is working
261261
`should function for intra-pod communication`,
262262
`should function for node-pod communication`,
263-
// consistent 500 errors
264-
"should expose prometheus metrics for a route",
265-
"should expose the profiling endpoints",
266263
// super flaky
267264
"should only deploy the last deployment",
268265

0 commit comments

Comments
 (0)