Skip to content

Commit cd9166f

Browse files
author
Mengqi Yu
committed
support optional identifier for handlers
1 parent 0f4719b commit cd9166f

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

pkg/webhook/admission/webhook.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,13 @@ type Handler interface {
4242
Handle(context.Context, atypes.Request) atypes.Response
4343
}
4444

45+
// NameGetter gets the name of the Handler
46+
type NameGetter interface {
47+
// Name returns the name of the Handler.
48+
// The name should be a feature name that can be the identifier for the handler.
49+
Name() string
50+
}
51+
4552
// HandlerFunc implements Handler interface using a single function.
4653
type HandlerFunc func(context.Context, atypes.Request) atypes.Response
4754

0 commit comments

Comments
 (0)