Skip to content

Commit

Permalink
Don't produce an error if there are no webhooks (#48)
Browse files Browse the repository at this point in the history
kustomize or operators could result in having a webhook config with no
webhooks. This shouldn't be an error.

Signed-off-by: Haiyan Meng <haiyanmeng@google.com>

Signed-off-by: Haiyan Meng <haiyanmeng@google.com>
  • Loading branch information
haiyanmeng committed Sep 26, 2022
1 parent ba73f0c commit 112e77e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/rotator/rotator.go
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ func injectCertToWebhook(wh *unstructured.Unstructured, certPem []byte) error {
return err
}
if !found {
return errors.New("`webhooks` field not found in ValidatingWebhookConfiguration")
return nil
}
for i, h := range webhooks {
hook, ok := h.(map[string]interface{})
Expand Down

0 comments on commit 112e77e

Please sign in to comment.