fix: avoid checking if the webhook needs updating when static webhook is active
@@ -182,10 +182,14 @@ func (r *ReconcileSPOd) Reconcile(_ context.Context, req reconcile.Request) (rec
}
spodUpdate := spodNeedsUpdate(configuredSPOd, foundSPOd)
- hookUpdate, err := webhook.NeedsUpdate(ctx, r.client)
+
+ var hookUpdate bool
+ if !spod.Spec.StaticWebhookConfig {
+ hookUpdate, err = webhook.NeedsUpdate(ctx, r.client)
if err != nil {
return reconcile.Result{}, fmt.Errorf("determining if webhook needs update: %w", err)
}
+ }
if spodUpdate || hookUpdate {
updatedSPod := foundSPOd.DeepCopy()
