plugin/clouddns: add endpoint directive (#8618)

Brings clouddns to parity with route53, which already exposes
aws_endpoint for overriding the API endpoint (useful for pointing at a
local emulator or test environment). clouddns has no equivalent - its
client constructor only ever accepts a credentials option.

Changes f's single option.ClientOption parameter to variadic
...option.ClientOption so credentials and endpoint can be combined, and
adds the endpoint case wired to option.WithEndpoint, Google's own
client option for this exact purpose.

Extends TestSetupCloudDNS with endpoint coverage (valid value, missing
arg). Verified it fails without the setup.go change (unknown property
error) and passes with it.

Signed-off-by: stackedbyaradhya <aradhyaj736@gmail.com>
This commit is contained in:
Aradhya Jain
2026-10-09 13:58:35 +05:30
committed by GitHub
parent ef18404448
commit 123829d3b3
3 changed files with 34 additions and 14 deletions

View File

@@ -20,6 +20,7 @@ the hosted zone.
~~~ txt
clouddns [ZONE:PROJECT_ID:HOSTED_ZONE_NAME...] {
credentials [FILENAME]
endpoint ENDPOINT
fallthrough [ZONES...]
refresh DURATION
}
@@ -41,6 +42,10 @@ clouddns [ZONE:PROJECT_ID:HOSTED_ZONE_NAME...] {
Google Cloud's [authentication method](https://cloud.google.com/docs/authentication) and
[validating credential configurations from external sources](https://docs.cloud.google.com/docs/authentication/client-libraries#external-credentials) for more details.
* `endpoint` can be used to control the endpoint to use when querying Cloud DNS (optional).
**ENDPOINT** is the URL of the endpoint to use. If this is not provided the default Cloud DNS
endpoint is used. Useful for pointing at a local emulator or test environment.
* `fallthrough` If zone matches and no record can be generated, pass request to the next plugin.
If **[ZONES...]** is omitted, then fallthrough happens for all zones for which the plugin is
authoritative. If specific zones are listed (for example `in-addr.arpa` and `ip6.arpa`), then
@@ -90,3 +95,13 @@ example.org {
}
}
~~~
Enable clouddns against a custom Cloud DNS endpoint:
~~~ txt
example.org {
clouddns example.org.:gcp-example-project:example-zone {
endpoint https://dns.googleapis.com
}
}
~~~