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

If record is not present, create it #6

Open
criscola opened this issue May 7, 2023 · 0 comments
Open

If record is not present, create it #6

criscola opened this issue May 7, 2023 · 0 comments

Comments

@criscola
Copy link
Owner

criscola commented May 7, 2023

If record is not present, app should create it, else there will be an error

cannot update IPv4 root record: error unmarshalling the JSON response: json: cannot unmarshal array into Go struct field DNSRecordResponse.result of type cloudflare.DNSRecord

this is due to client.getIpv4Record returning an empty cloudflare.DNSRecord struct.

Checks that make it fail are here: https://github.com/criscola/cloudflare-ddns/blob/main/ddns/client.go#L118 https://github.com/criscola/cloudflare-ddns/blob/main/ddns/client.go#L127 (record.Name == name).

Note if the record is already present with same name as zone, no error is thrown.

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