Skip to content
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

URL broken on main #24

Open
rafal11ck opened this issue Feb 8, 2025 · 0 comments
Open

URL broken on main #24

rafal11ck opened this issue Feb 8, 2025 · 0 comments

Comments

@rafal11ck
Copy link

external-dns-provider-opnsense
version: main (a40a91c25439b4d20bda6b28bb12680fba9538f4)

{"level":"info","msg":"creating opnsense provider with no kind of domain filters","time":"2025-02-07T21:23:17Z"}
{"level":"debug","msg":"doRequest: making GET request to https://192.168.0.1/api/service/status","time":"2025-02-07T21:23:17Z"}
{"level":"debug","msg":"headers: Requesting https://192.168.0.1/api/service/status","time":"2025-02-07T21:23:17Z"}
{"level":"debug","msg":"doRequest: response code from GET request to https://192.168.0.1/api/service/status: 404","time":"2025-02-07T21:23:17Z"}
{"level":"fatal","msg":"failed to initialize provider: provider: failed to create the opnsense client: doRequest: GET request to https://192.168.0.1/api/service/status was not successful: 404","time
stream closed EOF for network/external-dns-opnsense-77c8548f6b-slctp (webhook)

Begining of function can be changed to following to see this

// doRequest makes an HTTP request to the Opnsense firewall.
func (c *httpClient) doRequest(method, path string, body io.Reader) (*http.Response, error) {
	log.Debugf("doRequest: base path is %s", c.baseURL)

	u := c.baseURL.ResolveReference(&url.URL{
		Path: path,
	})

	log.Debugf("doRequest: making %s request to %s", method, u)

Image

I think this is cause:

	u := c.baseURL.ResolveReference(&url.URL{
		Path: path,
	})

720fe63#diff-7e8d3383a9edcf2a8ad5970710a2d762862b49eb204bb7b4ad364e971cdbbbdcR80-R84
It was merged day after v0.1.0 image was released so it's likely not issue there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant