-
Notifications
You must be signed in to change notification settings - Fork 3
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
Webhook stops when there are no records for a domain at netcup #5
Comments
Good catch, I never tried it with a completely empty domain. It should be easy to reproduce, so hopefully can provide a quick fix in the next days. |
@aellwein do you know if there's a way to detect that specific error in the api client? ? Otherwise I guess I'll remove the error handling around InfoDnsRecords() to make this work. |
@mrueg unfortunately, the Netcup DNS API response is very unspecific and sometimes misleading; fmpov this particular one should be a "warning" type of response, not an error. In the API client, however, the response is assumed to be a fatal one, if it's not a "success". An error is passed in any non-"success" type of response. A suggestion: i can extend the API client to pass through the NetcupBaseResponseMessage as an additional return type from any API call. The API's user can then inspect the error code and status on his own. This would be a breaking change for the client and require a new release with a major version increase. So i would rather proceed with the API client's extension. |
@mrueg on a second thought: you could check the LastResponse attribute of the NetcupSession, it contains exactly the as-is response from Netcup DNS API. Hint: probably you'll need to add a treatment of (response.Status == string(netcup.StatusError) && response.StatusCode == 5029). Maybe we don't need the extension of API client, but to document how the potential error could be extracted. |
I'll take a look and see if that works. Otherwise your other suggestion sounds good to me as well. |
Netcup API responds with an error response (status "error", code 5209), see discussion in mrueg/external-dns-netcup-webhook#5. In order to make this error recoverable, we add a special treatment for exactly this kind of error upon calling of InfoDnsRecords(). Refs: #41, mrueg/external-dns-netcup-webhook#5
Netcup API responds with an error response (status "error", code 5209), see discussion in mrueg/external-dns-netcup-webhook#5. In order to make this error recoverable, we add a special treatment for exactly this kind of error upon calling of InfoDnsRecords(). Fixes: #41 Refs: mrueg/external-dns-netcup-webhook#5
Netcup API responds with an error response (status "error", code 5209), see discussion in mrueg/external-dns-netcup-webhook#5. In order to make this error recoverable, we add a special treatment for exactly this kind of error upon calling of InfoDnsRecords(). Fixes: #41 Refs: mrueg/external-dns-netcup-webhook#5
Please let me know if prerelease 0.0.7 resolves the issue for you. |
With the container image of 0.0.7 I get this in a row somehow:
After adding a dummy entry via netcup web-ui it works fine. |
@mrueg i think the API client does not return an empty We could add an additional check for the pointer before iterating, or maybe adapt the API client to return a pointer to an an empty slice in any case to prevent such errors. WDYT? Update: i've released the client 1.0.4 with mentioned improvements, any feedback is welcome, thanks. |
Thanks @aellwein for the fix in the library! @webwurst can you test with the following release please? |
Closing this as I haven't received a response. |
Thanks for providing this webhook :)
I think I found an issue:
In case all records are deleted for a domain the Netcup DNS API fails instead of responding with an empty result when trying to list the records.
And it seems this webhook then just stops. It should be fine to ignore this error and just go on with creating the records collected from the Kubernetes sources.
The text was updated successfully, but these errors were encountered: