Skip to content

Commit

Permalink
fix: make the webhook tolerations configurable
Browse files Browse the repository at this point in the history
Signed-off-by: Cosmin Cojocar <gcojocar@adobe.com>
  • Loading branch information
ccojocar committed Apr 13, 2022
1 parent ac82a2e commit fc2b176
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions internal/pkg/manager/spod/bindata/webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,13 @@ func GetWebhook(
image string,
pullPolicy corev1.PullPolicy,
caInjectType CAInjectType,
tolerations []corev1.Toleration,
) *Webhook {
deployment := webhookDeployment.DeepCopy()
deployment.Namespace = namespace
if len(tolerations) > 0 {
deployment.Spec.Template.Spec.Tolerations = tolerations
}

ctr := &deployment.Spec.Template.Spec.Containers[0]
ctr.Image = image
Expand Down
3 changes: 2 additions & 1 deletion internal/pkg/manager/spod/spod_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,8 @@ func (r *ReconcileSPOd) Reconcile(_ context.Context, req reconcile.Request) (rec
}
configuredSPOd := r.getConfiguredSPOd(spod, image, pullPolicy, caInjectType)

webhook := bindata.GetWebhook(r.log, r.namespace, spod.Spec.WebhookOpts, image, pullPolicy, caInjectType)
webhook := bindata.GetWebhook(r.log, r.namespace, spod.Spec.WebhookOpts, image,
pullPolicy, caInjectType, spod.Spec.Tolerations)
metricsService := bindata.GetMetricsService(r.namespace, caInjectType)

var certManagerResources *bindata.CertManagerResources
Expand Down

0 comments on commit fc2b176

Please sign in to comment.