-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Install APIGroup once for multiple DNS providers #4702
Install APIGroup once for multiple DNS providers #4702
Conversation
If we register multiple DNS providers while running the webhook server, it will cause an unexpected exit with 'WebService with duplicate root path detected' error. This issue happens because the root path of each DNS provider is equal since they share the group name. This commit installs APIGroup once for multiple DNS providers by extracting apiGroupInfo variable and InstallAPIGroup call from solver (DNS provider) loop in ChallengeServer constructor. Signed-off-by: Sunghoon Kang <hoon@linecorp.com>
Hi @devholic. Thanks for your PR. I'm waiting for a jetstack member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Hi, thanks for opening the PR! I am not very familiar with this part of the code- would you be able to add some extra information to the PR? Are you writing a custom webhook and what config caused the error?
I see that this error comes from go-restful and the go-restful function that throws the error seems to be called from kubernetes endpoints package. It makes sense to not re-install the same GroupVersion multiple times, but I am wondering if whether there can ever be different GroupVersions for different solvers that are being looped over here. If you could add some extra information as to what setup you had that resulted in the error that would be very helpful. |
Sorry for the lack of context sharing 🙇 As you guessed, I'm trying to build a custom webhook for OpenStack Designate. For example:
It seems RunWebhookServer, which is an entrypoint for building custom webhook, takes a single |
Thanks for that extra context!
You're right about this 👍🏼 I've looked over the code again- so it looks like the only solver-specific action that is done in that for-loop is adding a challenge handler for the specific resource to the versioned resources storage map here and this bit should keep functioning in the same way with either one or more solvers, since we only create a new versioned resources storage map if it doesn't exist, else the existing one will be updated (here). I guess arguably we could take the creation of the map out of the for-loop, however that would again need changing if a new version is added, so this should be ok as is 👍🏼 I'm a little concerned that we don't have any tests for this functionality. Have you tested that your webhook works with this change? /ok-to-test |
Signed-off-by: Sunghoon Kang <hoon@linecorp.com>
cb578db
to
47d07e8
Compare
I tested running multiple solvers with the current branch, but I agree with having a test for this functionality. However, |
Thank you very much for adding the test!
I cannot see any potential issue with that as it doesn't change the behaviour of how the kube config is obtained when a new webhook is created using I've also verified that the new test throws an error as in this PR's description when ran against current master 👍🏼 Thanks for confirming that this works for your webhook too. Adding a hold for a while to allow others to take a look, but this seems non-controversial to me. /hold |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: devholic, irbekrm, munnerz The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
What this PR does / why we need it:
If we register multiple DNS providers while running the webhook server, it will cause an unexpected exit with
WebService with duplicate root path detected
error.This issue happens because the root path of each DNS provider is equal since they share the group name.
To resolve this issue, this commit installs APIGroup once for multiple DNS providers by extracting apiGroupInfo variable and InstallAPIGroup call from solver (DNS provider) loop in ChallengeServer constructor.
Which issue this PR fixes
None
Special notes for your reviewer:
None
Release note:
/kind bug