spin-operator icon indicating copy to clipboard operation
spin-operator copied to clipboard

Unused SpinAppExecutor webhooks cause circular dependency conflict

Open chrismatteson opened this issue 1 year ago • 1 comments

Spin-Operator sets up validators and mutator webhooks for SpinApp and SpinAppExecutor. The ones for SpinAppExecutor currently are simply No-op and it's causing an issue when trying to install all of SpinKube in a single Helm chart. Namely the templates which trigger the webhooks get setup first here: https://github.com/spinkube/spin-operator/blob/main/charts/spin-operator/templates/mutating-webhook-configuration.yaml#L45

Then when the template to install the executor is run, the above code causes it to want to reach out to the webhook, which hasn't been setup yet, resulting in a failure.

However these webhook don't currently do anything: https://github.com/spinkube/spin-operator/blob/main/internal/webhook/spinappexecutor_defaulting.go

So either can try to ensure that the the SpinAppExecutor template happens before mutating-webhook-configuration template or after the webhook is up. But since the webhook isn't doing anything yet, we should probably disable it for now.

Here is the proof of concept code: https://github.com/jpflueger/spinkube-oneclick

Context: This will be very helpful for two reasons:

  1. Demos: We need an automatic way to get SpinKube running as fast as possible
  2. Marketplaces: It seems the K8s marketplaces all want Helm as an input

chrismatteson avatar May 06 '24 22:05 chrismatteson

Is cert-manager running when you get the error? You might get the error if cert-manager isn't ready

adamreese avatar Jun 27 '24 20:06 adamreese