Open thesuperzapper opened 2 months ago
I have found a possible way to run a local version of the webhook.
We can do something similar to the external-secrets project and use Tilt, which lets you automatically swap Go binaries into a Pod running on the cluster as you are developing, without needing to rebuild the images.
See their dev-guide for more examples of how to do it:
Right now, if contributor runs
make run
from inside the./workspaces/controller/
folder, it will only run the controller loops, and the Validating webhooks are not used, meaning important validations are not applied.We should clarify how we expect people to run a local version of the workspace controller in the development guide:
make test
make test-e2e
make test
make test-e2e
make deploy
to actually run this on a cluster (probably only on local kind so you can runkind load docker-image ...
).make run
and the controller should reconcile the cluster of your currentkubectl
context.There are more complicated methods to improve 2, so that a local version of the webhook can be run on a local kind cluster, so I guess we could provide a
make run-kind
which patches theValidatingWebhookConfiguration
to usehttps://host.docker.internal:9443/<webhook-endpoint>
and generate the appropreate SSH key pairs, see this upstream issue for more ideas: