fix(admission): use client network, fail-open on nil gRPC client, close http resources

- Use client address network instead of listener network in admission wrapper
- Return true (allow) when gRPC admission plugin client is nil to fail-open
- Add Close() to httpPlugin to close idle HTTP connections
- Close httpLoader in localAdmission.Close()
- Remove dead commented-out code in periodReload
This commit is contained in:
ginuerzh
2026-05-22 15:58:24 +08:00
parent 70dee081a4
commit ed93d60004
4 changed files with 12 additions and 3 deletions
+3 -1
View File
@@ -145,7 +145,6 @@ func (p *localAdmission) periodReload(ctx context.Context) error {
case <-ticker.C:
if err := p.reload(ctx); err != nil {
p.logger.Warnf("reload: %v", err)
// return err
}
case <-ctx.Done():
return ctx.Err()
@@ -279,6 +278,9 @@ func (p *localAdmission) Close() error {
if p.options.redisLoader != nil {
p.options.redisLoader.Close()
}
if p.options.httpLoader != nil {
p.options.httpLoader.Close()
}
return nil
}