fix panic for nil pointer

This commit is contained in:
ginuerzh committed 2025-08-13 21:24:05 +08:00
1 parent 0e5c285eb7
commit d0ff5358df
4 files changed
+24 -6

No files matched your search

+5 -3
View File
@@ -89,9 +89,11 @@ func NewAdmission(opts ...Option) admission.Admission {
ctx, cancel := context.WithCancel(context.Background())
p := &localAdmission{
cancelFunc: cancel,
options: options,
logger: options.logger,
ipMatcher: matcher.NopMatcher(),
cidrMatcher: matcher.NopMatcher(),
cancelFunc: cancel,
options: options,
logger: options.logger,
}
if p.logger == nil {
p.logger = xlogger.Nop()