Skip to content

Commit

Permalink
don't exit if webhook registration fails
Browse files Browse the repository at this point in the history
  • Loading branch information
rbren committed Feb 25, 2020
1 parent c591765 commit dad5262
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion cmd/polaris/webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,9 @@ var webhookCmd = &cobra.Command{
for innerIndex, supportedAPIType := range controllerToScan.ListSupportedAPIVersions() {
webhookName := strings.ToLower(fmt.Sprintf("%s-%d-%d", controllerToScan, index, innerIndex))
hook := fwebhook.NewWebhook(webhookName, mgr, fwebhook.Validator{Config: config}, supportedAPIType)
webhooks = append(webhooks, hook)
if hook != nil {
webhooks = append(webhooks, hook)
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/webhook/validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ func NewWebhook(name string, mgr manager.Manager, validator Validator, apiType r
Build()
if err != nil {
logrus.Errorf("Error building webhook: %v", err)
os.Exit(1)
return nil
} else {
logrus.Info(name + " webhook started")
}
Expand Down

0 comments on commit dad5262

Please sign in to comment.