-
Notifications
You must be signed in to change notification settings - Fork 447
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 |
commit 1fae2e8 Author: Luis Gracia <[email protected]> Date: Wed Dec 18 09:52:36 2024 +1300 Update README.md Add reference to new project commit bb36abe Author: Luis Gracia <[email protected]> Date: Wed Oct 2 16:11:41 2024 +1300 Deprecate repo commit ef886b6 Author: Luis Gracia <[email protected]> Date: Wed Apr 13 14:03:52 2022 -0400 Update version commit 03c5086 Merge: a09d627 040a813 Author: Luis Gracia <[email protected]> Date: Wed Apr 13 13:54:49 2022 -0400 Merge pull request cert-manager#5 from ONordander/feature/configure-cert-duration Add possibility to configure cert duration commit 040a813 Author: Otto Nordander <[email protected]> Date: Tue Apr 12 08:21:06 2022 +0200 Remove webhook prefix for certificates commit 10aee3f Author: Otto Nordander <[email protected]> Date: Tue Apr 12 08:20:54 2022 +0200 Add documentation of values.yaml commit 823531f Author: Otto Nordander <[email protected]> Date: Thu Apr 7 14:20:58 2022 +0200 Add possibility to configure cert duration commit a09d627 Merge: 55d0a22 75cb2b5 Author: Luis Gracia <[email protected]> Date: Tue Oct 12 14:47:43 2021 -0400 Merge pull request cert-manager#3 from luisico/upgrade-alpine Upgrade alpine image for container commit 75cb2b5 Author: Luis Gracia <[email protected]> Date: Tue Oct 12 14:46:17 2021 -0400 Upgrade alpine image for container Solve security issues pointed out by artifacthub. commit 55d0a22 Merge: 0e43959 95451b7 Author: Luis Gracia <[email protected]> Date: Tue Oct 12 13:11:25 2021 -0400 Merge pull request cert-manager#2 from luisico/release-on-tags Release on tags commit 95451b7 Author: Luis Gracia <[email protected]> Date: Tue Oct 12 13:08:36 2021 -0400 Always push docker images commit 5a75aa0 Author: Luis Gracia <[email protected]> Date: Tue Oct 12 10:31:25 2021 -0400 Version sync with cert-manager Version scheme to keep major and minor version in sync with cert-manager commit 3951e65 Author: Luis Gracia <[email protected]> Date: Tue Oct 12 12:31:52 2021 -0400 Use luisico/chart-releaser-action@on-tags helm/chart-releaser-action does not support actions triggered by tags commit dbec1b8 Author: Luis Gracia <[email protected]> Date: Mon Oct 11 19:09:35 2021 -0400 Release docker images and helm charts on tags commit 0360b99 Author: Luis Gracia <[email protected]> Date: Mon Oct 11 12:20:17 2021 -0400 Release docker image commit 3944741 Author: Luis Gracia <[email protected]> Date: Mon Oct 11 11:42:52 2021 -0400 Release helm chart commit 0e43959 Merge: 9440683 f977e2b Author: Luis Gracia <[email protected]> Date: Tue Oct 12 12:51:03 2021 -0400 Merge pull request cert-manager#1 from luisico/infoblox-wapi Infoblox wapi commit f977e2b Author: Luis Gracia <[email protected]> Date: Mon Oct 11 16:02:58 2021 -0400 Add NOTICE file listing files changes from the original source code commit 710488b Author: Luis Gracia <[email protected]> Date: Thu Oct 7 11:30:14 2021 -0400 Fix authorization for flowcontrol commit af684d5 Author: Luis Gracia <[email protected]> Date: Mon Oct 11 14:05:08 2021 -0400 Add namespaces commit a8c56ef Author: Luis Gracia <[email protected]> Date: Mon Oct 11 12:57:38 2021 -0400 Add readme commit c474d07 Author: Luis Gracia <[email protected]> Date: Fri Oct 8 12:21:50 2021 -0400 Adatap directory structure and files to new package name commit 203e7c4 Author: Luis Gracia <[email protected]> Date: Fri Oct 8 13:16:53 2021 -0400 Refactor txt record deletion commit 7d66a33 Author: Luis Gracia <[email protected]> Date: Thu Oct 7 19:01:07 2021 -0400 Add structured logs adhering to kubernetes guidelines - https://github.com/kubernetes/community/blob/master/contributors/devel/sig-instrumentation/logging.md - https://github.com/kubernetes/community/blob/master/contributors/devel/sig-instrumentation/migration-to-structured-logging.md commit eabd6df Author: Luis Gracia <[email protected]> Date: Tue Oct 5 17:16:35 2021 -0400 Initial adaptation for infoblox-wapi
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: