mirror of
https://github.com/coredns/coredns.git
synced 2026-10-17 07:45:42 -04:00
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:
@@ -13,7 +13,7 @@ import (
|
||||
)
|
||||
|
||||
func TestSetupCloudDNS(t *testing.T) {
|
||||
f = func(_ctx context.Context, _opt option.ClientOption) (gcpDNS, error) {
|
||||
f = func(_ctx context.Context, _opts ...option.ClientOption) (gcpDNS, error) {
|
||||
return fakeGCPClient{}, nil
|
||||
}
|
||||
|
||||
@@ -73,6 +73,12 @@ func TestSetupCloudDNS(t *testing.T) {
|
||||
}`, true},
|
||||
{`clouddns example.org.:example-project:zone-name {
|
||||
refresh -5m
|
||||
}`, true},
|
||||
{`clouddns example.org.:example-project:zone-name {
|
||||
endpoint https://dns.googleapis.com
|
||||
}`, false},
|
||||
{`clouddns example.org.:example-project:zone-name {
|
||||
endpoint
|
||||
}`, true},
|
||||
{`clouddns example.org.:example-project:zone-name example.org.:example-project:zone-name {
|
||||
}`, true},
|
||||
|
||||
Reference in New Issue
Block a user