Merge pull request #88879 from JoshVanL/88878-apiserver-webhook-config-panic
Checks error for loading audit webhook config to prevent panic
This commit is contained in:
commit
381a372455
@ -64,8 +64,12 @@ func retryOnError(err error) bool {
|
|||||||
func loadWebhook(configFile string, groupVersion schema.GroupVersion, initialBackoff time.Duration, customDial utilnet.DialFunc) (*webhook.GenericWebhook, error) {
|
func loadWebhook(configFile string, groupVersion schema.GroupVersion, initialBackoff time.Duration, customDial utilnet.DialFunc) (*webhook.GenericWebhook, error) {
|
||||||
w, err := webhook.NewGenericWebhook(audit.Scheme, audit.Codecs, configFile,
|
w, err := webhook.NewGenericWebhook(audit.Scheme, audit.Codecs, configFile,
|
||||||
[]schema.GroupVersion{groupVersion}, initialBackoff, customDial)
|
[]schema.GroupVersion{groupVersion}, initialBackoff, customDial)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
w.ShouldRetry = retryOnError
|
w.ShouldRetry = retryOnError
|
||||||
return w, err
|
return w, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
type backend struct {
|
type backend struct {
|
||||||
|
Loading…
Reference in New Issue
Block a user