Check for existing resources before creating them

Prevents errors when starting with fail-closed webhooks

Also, use panic instead of Fatalf so that the CloudControllerManager rescue can handle the error

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
This commit is contained in:
Brad Davidson
2023-02-07 01:34:02 +00:00
committed by Brad Davidson
parent 32d62c5786
commit c6d0afd0cb
4 changed files with 27 additions and 18 deletions

View File

@@ -54,6 +54,7 @@ rules:
- serviceaccounts
verbs:
- create
- get
- apiGroups:
- ""
resources: