Skip to content

Commit 425cb6f

Browse files
authored
go.mod: pull in the latest cloudflare API libs (#28336)
1 parent f62c58f commit 425cb6f

File tree

3 files changed

+53
-30
lines changed

3 files changed

+53
-30
lines changed

cmd/devp2p/dns_cloudflare.go

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ func (c *cloudflareClient) uploadRecords(name string, records map[string]string)
114114
records = lrecords
115115

116116
log.Info(fmt.Sprintf("Retrieving existing TXT records on %s", name))
117-
entries, err := c.DNSRecords(context.Background(), c.zoneID, cloudflare.DNSRecord{Type: "TXT"})
117+
entries, _, err := c.ListDNSRecords(context.Background(), cloudflare.ZoneIdentifier(c.zoneID), cloudflare.ListDNSRecordsParams{Type: "TXT"})
118118
if err != nil {
119119
return err
120120
}
@@ -141,14 +141,25 @@ func (c *cloudflareClient) uploadRecords(name string, records map[string]string)
141141
if path != name {
142142
ttl = treeNodeTTLCloudflare // Max TTL permitted by Cloudflare
143143
}
144-
record := cloudflare.DNSRecord{Type: "TXT", Name: path, Content: val, TTL: ttl}
145-
_, err = c.CreateDNSRecord(context.Background(), c.zoneID, record)
144+
record := cloudflare.CreateDNSRecordParams{Type: "TXT", Name: path, Content: val, TTL: ttl}
145+
_, err = c.CreateDNSRecord(context.Background(), cloudflare.ZoneIdentifier(c.zoneID), record)
146146
} else if old.Content != val {
147147
// Entry already exists, only change its content.
148148
log.Info(fmt.Sprintf("Updating %s from %q to %q", path, old.Content, val))
149149
updated++
150-
old.Content = val
151-
err = c.UpdateDNSRecord(context.Background(), c.zoneID, old.ID, old)
150+
151+
record := cloudflare.UpdateDNSRecordParams{
152+
Type: old.Type,
153+
Name: old.Name,
154+
Content: val,
155+
Data: old.Data,
156+
ID: old.ID,
157+
Priority: old.Priority,
158+
TTL: old.TTL,
159+
Proxied: old.Proxied,
160+
Tags: old.Tags,
161+
}
162+
_, err = c.UpdateDNSRecord(context.Background(), cloudflare.ZoneIdentifier(c.zoneID), record)
152163
} else {
153164
skipped++
154165
log.Debug(fmt.Sprintf("Skipping %s = %q", path, val))
@@ -168,7 +179,7 @@ func (c *cloudflareClient) uploadRecords(name string, records map[string]string)
168179
// Stale entry, nuke it.
169180
log.Debug(fmt.Sprintf("Deleting %s = %q", path, entry.Content))
170181
deleted++
171-
if err := c.DeleteDNSRecord(context.Background(), c.zoneID, entry.ID); err != nil {
182+
if err := c.DeleteDNSRecord(context.Background(), cloudflare.ZoneIdentifier(c.zoneID), entry.ID); err != nil {
172183
return fmt.Errorf("failed to delete %s: %v", path, err)
173184
}
174185
}

go.mod

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ require (
1212
github.com/aws/aws-sdk-go-v2/service/route53 v1.30.2
1313
github.com/btcsuite/btcd/btcec/v2 v2.2.0
1414
github.com/cespare/cp v0.1.0
15-
github.com/cloudflare/cloudflare-go v0.14.0
15+
github.com/cloudflare/cloudflare-go v0.79.0
1616
github.com/cockroachdb/errors v1.8.1
1717
github.com/cockroachdb/pebble v0.0.0-20230928194634-aa077af62593
1818
github.com/consensys/gnark-crypto v0.12.1
@@ -22,7 +22,7 @@ require (
2222
github.com/docker/docker v24.0.5+incompatible
2323
github.com/dop251/goja v0.0.0-20230806174421-c933cf95e127
2424
github.com/ethereum/c-kzg-4844 v0.3.1
25-
github.com/fatih/color v1.7.0
25+
github.com/fatih/color v1.13.0
2626
github.com/fjl/gencodec v0.0.0-20230517082657-f9840df7b83e
2727
github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5
2828
github.com/fsnotify/fsnotify v1.6.0
@@ -58,7 +58,7 @@ require (
5858
github.com/rs/cors v1.7.0
5959
github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible
6060
github.com/status-im/keycard-go v0.2.0
61-
github.com/stretchr/testify v1.8.2
61+
github.com/stretchr/testify v1.8.4
6262
github.com/supranational/blst v0.3.11
6363
github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7
6464
github.com/tyler-smith/go-bip39 v1.1.0
@@ -105,16 +105,20 @@ require (
105105
github.com/garslo/gogen v0.0.0-20170306192744-1d203ffc1f61 // indirect
106106
github.com/go-ole/go-ole v1.2.5 // indirect
107107
github.com/go-sourcemap/sourcemap v2.1.3+incompatible // indirect
108+
github.com/goccy/go-json v0.10.2 // indirect
108109
github.com/gogo/protobuf v1.3.2 // indirect
109110
github.com/google/go-cmp v0.5.9 // indirect
111+
github.com/google/go-querystring v1.1.0 // indirect
110112
github.com/google/pprof v0.0.0-20230207041349-798e818bf904 // indirect
113+
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
114+
github.com/hashicorp/go-retryablehttp v0.7.4 // indirect
111115
github.com/influxdata/line-protocol v0.0.0-20200327222509-2487e7298839 // indirect
112116
github.com/jmespath/go-jmespath v0.4.0 // indirect
113117
github.com/kilic/bls12-381 v0.1.0 // indirect
114118
github.com/klauspost/compress v1.15.15 // indirect
115119
github.com/kr/pretty v0.3.1 // indirect
116120
github.com/kr/text v0.2.0 // indirect
117-
github.com/mattn/go-runewidth v0.0.9 // indirect
121+
github.com/mattn/go-runewidth v0.0.13 // indirect
118122
github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect
119123
github.com/mitchellh/mapstructure v1.4.1 // indirect
120124
github.com/mitchellh/pointerstructure v1.2.0 // indirect
@@ -127,13 +131,14 @@ require (
127131
github.com/prometheus/client_model v0.2.1-0.20210607210712-147c58e9608a // indirect
128132
github.com/prometheus/common v0.32.1 // indirect
129133
github.com/prometheus/procfs v0.7.3 // indirect
134+
github.com/rivo/uniseg v0.2.0 // indirect
130135
github.com/rogpeppe/go-internal v1.9.0 // indirect
131136
github.com/russross/blackfriday/v2 v2.1.0 // indirect
132137
github.com/tklauser/go-sysconf v0.3.12 // indirect
133138
github.com/tklauser/numcpus v0.6.1 // indirect
134139
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect
135140
golang.org/x/mod v0.12.0 // indirect
136-
golang.org/x/net v0.15.0 // indirect
141+
golang.org/x/net v0.17.0 // indirect
137142
google.golang.org/protobuf v1.27.1 // indirect
138143
gopkg.in/yaml.v2 v2.4.0 // indirect
139144
gotest.tools/v3 v3.5.1 // indirect

0 commit comments

Comments
 (0)