mirror of
https://github.com/coredns/coredns.git
synced 2025-10-27 16:24:19 -04:00
plugin/clouddns: remove initialization from init (#3349)
* plugin/clouddns: remove initialization from init Init should just call the plugin.Register with a setup function. Fixes: #3343 Signed-off-by: Miek Gieben <miek@miek.nl> * Fix placement for var f Signed-off-by: Miek Gieben <miek@miek.nl>
This commit is contained in:
@@ -9,7 +9,7 @@ import (
|
||||
)
|
||||
|
||||
func TestSetupCloudDNS(t *testing.T) {
|
||||
f := func(ctx context.Context, opt option.ClientOption) (gcpDNS, error) {
|
||||
f = func(ctx context.Context, opt option.ClientOption) (gcpDNS, error) {
|
||||
return fakeGCPClient{}, nil
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ func TestSetupCloudDNS(t *testing.T) {
|
||||
|
||||
for _, test := range tests {
|
||||
c := caddy.NewTestController("dns", test.body)
|
||||
if err := setup(c, f); (err == nil) == test.expectedError {
|
||||
if err := setup(c); (err == nil) == test.expectedError {
|
||||
t.Errorf("Unexpected errors: %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user