CLOUDFLAREAPI: Update cloudflare-go to v0.68 (#2390)

This commit is contained in:
Hamish Moffatt 2023-05-24 20:20:11 +10:00 committed by GitHub
parent fb1f2bd27a
commit 1405901171
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 6 deletions

2
go.mod
View file

@ -19,7 +19,7 @@ require (
github.com/babolivier/go-doh-client v0.0.0-20201028162107-a76cff4cb8b6 github.com/babolivier/go-doh-client v0.0.0-20201028162107-a76cff4cb8b6
github.com/bhendo/go-powershell v0.0.0-20190719160123-219e7fb4e41e github.com/bhendo/go-powershell v0.0.0-20190719160123-219e7fb4e41e
github.com/billputer/go-namecheap v0.0.0-20210108011502-994a912fb7f9 github.com/billputer/go-namecheap v0.0.0-20210108011502-994a912fb7f9
github.com/cloudflare/cloudflare-go v0.58.1 github.com/cloudflare/cloudflare-go v0.68.0
github.com/digitalocean/godo v1.99.0 github.com/digitalocean/godo v1.99.0
github.com/ditashi/jsbeautifier-go v0.0.0-20141206144643-2520a8026a9c github.com/ditashi/jsbeautifier-go v0.0.0-20141206144643-2520a8026a9c
github.com/dnsimple/dnsimple-go v1.2.0 github.com/dnsimple/dnsimple-go v1.2.0

4
go.sum
View file

@ -84,8 +84,8 @@ github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XL
github.com/chzyer/logex v1.2.1/go.mod h1:JLbx6lG2kDbNRFnfkgvh4eRJRPX1QCoOIWomwysCBrQ= github.com/chzyer/logex v1.2.1/go.mod h1:JLbx6lG2kDbNRFnfkgvh4eRJRPX1QCoOIWomwysCBrQ=
github.com/chzyer/test v1.0.0/go.mod h1:2JlltgoNkt4TW/z9V/IzDdFaMTM2JPIi26O1pF38GC8= github.com/chzyer/test v1.0.0/go.mod h1:2JlltgoNkt4TW/z9V/IzDdFaMTM2JPIi26O1pF38GC8=
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
github.com/cloudflare/cloudflare-go v0.58.1 h1:+Tqt4N9nuNEMgSC3tCQOixyifU5jihaq+JfDQidTSgY= github.com/cloudflare/cloudflare-go v0.68.0 h1:YmCaLt0lUqZwxJp6fTrFX2fjb0zQZoKS8lFRMdwZKDI=
github.com/cloudflare/cloudflare-go v0.58.1/go.mod h1:QaA8x4JI0/gA/tni1nTdyimFuyEGJi8cB7YSGoFhXFo= github.com/cloudflare/cloudflare-go v0.68.0/go.mod h1:b6oSYwhXmZUdaF83Od/uefT092M41HHis/z6JFsT/kw=
github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc=
github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk=
github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI=

View file

@ -159,7 +159,7 @@ func (c *cloudflareProvider) createRec(rec *models.RecordConfig, domainID string
return err return err
} }
// Updating id (from the outer scope) by side-effect, required for updating proxy mode // Updating id (from the outer scope) by side-effect, required for updating proxy mode
id = resp.Result.ID id = resp.ID
return nil return nil
}, },
}} }}
@ -226,7 +226,7 @@ func (c *cloudflareProvider) createRecDiff2(rec *models.RecordConfig, domainID s
} }
// Records are created with the proxy off. If proxy should be // Records are created with the proxy off. If proxy should be
// enabled, we do a second API call. // enabled, we do a second API call.
resultID := resp.Result.ID resultID := resp.ID
if rec.Metadata[metaProxy] == "on" { if rec.Metadata[metaProxy] == "on" {
return c.modifyRecord(domainID, resultID, true, rec) return c.modifyRecord(domainID, resultID, true, rec)
} }
@ -270,7 +270,8 @@ func (c *cloudflareProvider) modifyRecord(domainID, recID string, proxied bool,
r.Data = cfDSData(rec) r.Data = cfDSData(rec)
r.Content = "" r.Content = ""
} }
return c.cfClient.UpdateDNSRecord(context.Background(), cloudflare.ZoneIdentifier(domainID), r) _, err := c.cfClient.UpdateDNSRecord(context.Background(), cloudflare.ZoneIdentifier(domainID), r)
return err
} }
// change universal ssl state // change universal ssl state