From faf4528ab98d3cad306b01f4c57c9c5907ddfcc1 Mon Sep 17 00:00:00 2001 From: default Date: Sun, 4 Aug 2024 19:20:26 +0000 Subject: [PATCH] Update provider --- go.mod | 2 +- go.sum | 4 ++-- module.go | 17 +++++------------ 3 files changed, 8 insertions(+), 15 deletions(-) diff --git a/go.mod b/go.mod index 6abaa4d..a38233d 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.21.5 require ( github.com/caddyserver/caddy/v2 v2.7.6 - github.com/profcomff/libdns-yandex-cloud v0.0.0-20240804182925-41d9be60a040 + github.com/profcomff/libdns-yandex-cloud v0.0.0-20240804191736-c413779159d2 ) require ( diff --git a/go.sum b/go.sum index d6d0e51..075822e 100644 --- a/go.sum +++ b/go.sum @@ -49,8 +49,8 @@ github.com/onsi/gomega v1.27.6 h1:ENqfyGeS5AX/rlXDd/ETokDz93u0YufY1Pgxuy/PvWE= github.com/onsi/gomega v1.27.6/go.mod h1:PIQNjfQwkP3aQAH7lf7j87O/5FiNr+ZR8+ipb+qQlhg= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/profcomff/libdns-yandex-cloud v0.0.0-20240804182925-41d9be60a040 h1:hoSbWAGZRkuik7W5yyFj5HnIOR83Lm4jutgl+j+U42s= -github.com/profcomff/libdns-yandex-cloud v0.0.0-20240804182925-41d9be60a040/go.mod h1:5x0hOozXCCSNJEznJ9ptgOcquDpnW4gSfYcdXo6MLaU= +github.com/profcomff/libdns-yandex-cloud v0.0.0-20240804191736-c413779159d2 h1:Krf57TZeOp9ld87x+1R6EG3CDWoqHxnCThOq82N4624= +github.com/profcomff/libdns-yandex-cloud v0.0.0-20240804191736-c413779159d2/go.mod h1:5x0hOozXCCSNJEznJ9ptgOcquDpnW4gSfYcdXo6MLaU= github.com/prometheus/client_golang v1.15.1 h1:8tXpTmJbyH5lydzFPoxSIJ0J46jdh3tylbvM1xCv0LI= github.com/prometheus/client_golang v1.15.1/go.mod h1:e9yaBhRPU2pPNsZwE+JdQl0KEt1N9XgF6zxWmaC0xOk= github.com/prometheus/client_model v0.4.0 h1:5lQXD3cAg1OXBf4Wq03gTrXHeaV0TQvGfUooCfx1yqY= diff --git a/module.go b/module.go index a068014..3d56cf7 100644 --- a/module.go +++ b/module.go @@ -3,11 +3,11 @@ package caddy_dns_yandex_cloud import ( "github.com/caddyserver/caddy/v2" "github.com/caddyserver/caddy/v2/caddyconfig/caddyfile" - libdns "github.com/profcomff/libdns-yandex-cloud" + yandex_cloud "github.com/profcomff/libdns-yandex-cloud" ) // Provider wraps the provider implementation as a Caddy module. -type Provider struct{ *libdns.Provider } +type Provider struct{ *yandex_cloud.Provider } func init() { caddy.RegisterModule(Provider{}) @@ -17,7 +17,7 @@ func init() { func (Provider) CaddyModule() caddy.ModuleInfo { return caddy.ModuleInfo{ ID: "dns.providers.yandex_cloud", - New: func() caddy.Module { return &Provider{new(libdns.Provider)} }, + New: func() caddy.Module { return &Provider{new(yandex_cloud.Provider)} }, } } @@ -31,8 +31,8 @@ func (p *Provider) Provision(ctx caddy.Context) error { // UnmarshalCaddyfile sets up the DNS provider from Caddyfile tokens. Syntax: // -// libdns [] { -// service_account_config_path ~/.yc/config.json for example +// yandex_cloud [] { +// service_account_config_path // } // func (p *Provider) UnmarshalCaddyfile(d *caddyfile.Dispenser) error { @@ -46,13 +46,6 @@ func (p *Provider) UnmarshalCaddyfile(d *caddyfile.Dispenser) error { for nesting := d.Nesting(); d.NextBlock(nesting); { switch d.Val() { case "service_account_config_path": - err := p.Provider.SetServiceConfig(d.Val()) - if err != nil{ - return err - } - if p.Provider.ServiceAccountConfigPath != "" { - return d.Err("config_path already set") - } p.Provider.ServiceAccountConfigPath = d.Val() if d.NextArg() { return d.ArgErr()