Skip to content

Commit

Permalink
fix(adfunc): fix adfunc repeated reference
Browse files Browse the repository at this point in the history
fix adfunc repeated reference

Signed-off-by: mritd <[email protected]>
  • Loading branch information
mritd committed Aug 19, 2020
1 parent 4965ea4 commit ea4c23a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/adfunc/adfuncs.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ func Setup() {
logger.Warnf("admission func handler path does not support '_', it has been automatically converted to '-'(%s => %s)", p, handlePath)
}

copyAf := af
route.RegisterHandler(route.HandleFunc{
Path: handlePath,
Method: http.MethodPost,
Expand Down Expand Up @@ -82,7 +83,7 @@ func Setup() {
return
}

resp, err := af.Func(reqReview.Request)
resp, err := copyAf.Func(reqReview.Request)
if err != nil {
route.ResponseErr(handlePath, fmt.Sprintf("admission func response: %s", err), http.StatusForbidden, w)
return
Expand Down

0 comments on commit ea4c23a

Please sign in to comment.