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:
Kubernetes Prow Robot 2020-03-09 06:05:40 -07:00 committed by GitHub
commit 381a372455
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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) {
w, err := webhook.NewGenericWebhook(audit.Scheme, audit.Codecs, configFile,
[]schema.GroupVersion{groupVersion}, initialBackoff, customDial)
if err != nil {
return nil, err
}
w.ShouldRetry = retryOnError
return w, err
return w, nil
}
type backend struct {