Skip to content

Commit

Permalink
Merge pull request #88879 from JoshVanL/88878-apiserver-webhook-confi…
Browse files Browse the repository at this point in the history
…g-panic

Checks error for loading audit webhook config to prevent panic
  • Loading branch information
k8s-ci-robot committed Mar 9, 2020
2 parents 5383e01 + 1bb6ed9 commit 381a372
Showing 1 changed file with 5 additions and 1 deletion.
Expand Up @@ -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 {
Expand Down

0 comments on commit 381a372

Please sign in to comment.