-
Notifications
You must be signed in to change notification settings - Fork 422
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make unit testing easier/make examples work #3
Comments
The documented command with the README file is also wrong as the domain name should been defined as such
and not as
|
If we add the content of this bash script and call it before to run the test
Bash script
and set the binary path here
then the test can work locally
|
Can we expect an update on the ticket ? @munnerz |
Hey folks 👋 I tried my hand at the (1) problem you mentioned @munnerz and now I'm struggling with even knowing what to do next 😂 You mention that the test suite doesn't try to set any records anywhere, but I'm wondering if it were possible to actually have this test run "live" with a test account with the provider you're trying to integrate with. I know it would obviously be better to mock everything if you're trying to setup CI/CD, but I'm currently just trying to get the project working and care a little bit less about best practices 🙈 😂 |
Hello! - relatively new cert-manager project member here reading some very old issues. I bumped the version of everything and made an example package that passes the text fixture. @mansona if you set |
ooo thanks @jakexks 👍 is the example package you talk about public? are you able to share a link? |
It's in the main repo, so pulling the latest changes and typing https://github.com/cert-manager/webhook-example/tree/master/example |
Ok so looking at this again, yes it looks like the new example works (as in the tests pass) but it now looks very different from the previous example 😂 I'm trying to use the examples and some info from forks of this repo to piece together a webhook handler even though I don't actually know how to write go 🙃 You mention I should set |
So I finally was able to push through and get the initial version of my webhook handler implemented 🎉 I'm going to try and get it tested in a real kubernetes deployment at some point over the next week: https://github.com/mansona/cert-manager-webhook-netlify I ended up not using your updated code @jakexks and more-so leaned on some other examples like https://github.com/NetWatcher/cert-manager-webhook-godaddy and https://github.com/bwolf/cert-manager-webhook-gandi I am interested in helping make this process a bit easier for people with a bit more guidance so if there is anything that I can try to assist with that please let me know. I will say that I'm not sure if my difficulty was caused by any lack of guidance from the example, or just my extreme lack of knowledge of golang 🙈 This is the first thing that I have ever written in golang |
@mansona Please were you able to get the netlify DNS webhook tested in Kubernetes? I'm currently experiencing the same issue, and seems there's very little documentation on how to handle the deployment. |
The |
Right now if you run
go test
within this repository, the tests will fail.They fail for a few reasons:
panic
on Present/CleanUp(1) can be fixed by adding a
fetch-binaries.sh
script (probably taken straight from sigs.k8s.io/controller-tools).(2) and (3) can be most easily fixed by embedding a 'fake dns server' into the webhook, which will listen for DNS queries and serve TXT records accordingly. This is how cert-manager itself handles tests for the RFC2136 DNS01 provider, and there is a reusable library that we can use to build it easily: https://github.com/jetstack/cert-manager/tree/master/test/acme/dns/server
The text was updated successfully, but these errors were encountered: