Skip to content

Commit 7a9a8ef

Browse files
author
Janik Rabe
authored
Remove "locked" flag of DNS records (cloudflare#1618)
This flag hasn't been used in quite a while and we're preparing to remove it from the API.
1 parent 228b052 commit 7a9a8ef

File tree

7 files changed

+8
-23
lines changed

7 files changed

+8
-23
lines changed

.changelog/1618.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:breaking-change
2+
dns: Remove "locked" flag which is always false
3+
```

cmd/flarectl/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,9 @@ a23b50de3c064a5a860e8b84cd2b382c Challenge Chrome v61 challenge Mozilla/5.0 (Mac
9898
```sh
9999
~ flarectl dns create --zone="example.com" --name="app" --type="CNAME" --content="myapp.herokuapp.com" --proxy
100100

101-
ID Name Type Content TTL Proxiable Proxy Locked
102-
-------------------------------- ------------------------- ----- ------------------- --- --------- ----- ------
103-
5c5d051f7944cf4715127270dd4d05f4 app.questionable.services CNAME myapp.herokuapp.com 1 true true false
101+
ID Name Type Content TTL Proxiable Proxy
102+
-------------------------------- ------------------------- ----- ------------------- --- --------- -----
103+
5c5d051f7944cf4715127270dd4d05f4 app.questionable.services CNAME myapp.herokuapp.com 1 true true
104104
```
105105

106106
## License

cmd/flarectl/dns.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ func formatDNSRecord(record cloudflare.DNSRecord) []string {
2020
strconv.FormatInt(int64(record.TTL), 10),
2121
strconv.FormatBool(record.Proxiable),
2222
strconv.FormatBool(*record.Proxied),
23-
strconv.FormatBool(record.Locked),
2423
}
2524
}
2625

@@ -60,7 +59,7 @@ func dnsCreate(c *cli.Context) error {
6059
formatDNSRecord(result),
6160
}
6261

63-
writeTable(c, output, "ID", "Name", "Type", "Content", "TTL", "Proxiable", "Proxy", "Locked")
62+
writeTable(c, output, "ID", "Name", "Type", "Content", "TTL", "Proxiable", "Proxy")
6463

6564
return nil
6665
}
@@ -135,7 +134,7 @@ func dnsCreateOrUpdate(c *cli.Context) error {
135134
formatDNSRecord(result),
136135
}
137136

138-
writeTable(c, output, "ID", "Name", "Type", "Content", "TTL", "Proxiable", "Proxy", "Locked")
137+
writeTable(c, output, "ID", "Name", "Type", "Content", "TTL", "Proxiable", "Proxy")
139138

140139
return nil
141140
}

dns.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ type DNSRecord struct {
3333
TTL int `json:"ttl,omitempty"`
3434
Proxied *bool `json:"proxied,omitempty"`
3535
Proxiable bool `json:"proxiable,omitempty"`
36-
Locked bool `json:"locked,omitempty"`
3736
Comment string `json:"comment,omitempty"` // the server will omit the comment field when the comment is empty
3837
Tags []string `json:"tags,omitempty"`
3938
}
@@ -192,7 +191,6 @@ type CreateDNSRecordParams struct {
192191
TTL int `json:"ttl,omitempty"`
193192
Proxied *bool `json:"proxied,omitempty" url:"proxied,omitempty"`
194193
Proxiable bool `json:"proxiable,omitempty"`
195-
Locked bool `json:"locked,omitempty"`
196194
Comment string `json:"comment,omitempty" url:"comment,omitempty"` // to the server, there's no difference between "no comment" and "empty comment"
197195
Tags []string `json:"tags,omitempty"`
198196
}

dns_test.go

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,6 @@ func TestCreateDNSRecord(t *testing.T) {
9898
"proxiable": true,
9999
"proxied": false,
100100
"ttl": 120,
101-
"locked": false,
102101
"zone_id": "d56084adb405e0b7e32c52321bf07be6",
103102
"zone_name": "example.com",
104103
"created_on": "2014-01-01T05:20:00Z",
@@ -180,7 +179,6 @@ func TestListDNSRecords(t *testing.T) {
180179
"proxiable": true,
181180
"proxied": false,
182181
"ttl": 120,
183-
"locked": false,
184182
"zone_id": "d56084adb405e0b7e32c52321bf07be6",
185183
"zone_name": "example.com",
186184
"created_on": "2014-01-01T05:20:00Z",
@@ -214,7 +212,6 @@ func TestListDNSRecords(t *testing.T) {
214212
Proxiable: true,
215213
Proxied: &proxied,
216214
TTL: 120,
217-
Locked: false,
218215
ZoneID: testZoneID,
219216
ZoneName: "example.com",
220217
CreatedOn: createdOn,
@@ -275,7 +272,6 @@ func TestListDNSRecordsSearch(t *testing.T) {
275272
"proxiable": true,
276273
"proxied": true,
277274
"ttl": 120,
278-
"locked": false,
279275
"zone_id": "d56084adb405e0b7e32c52321bf07be6",
280276
"zone_name": "example.com",
281277
"created_on": "2014-01-01T05:20:00Z",
@@ -310,7 +306,6 @@ func TestListDNSRecordsSearch(t *testing.T) {
310306
Proxiable: true,
311307
Proxied: &proxied,
312308
TTL: 120,
313-
Locked: false,
314309
ZoneID: testZoneID,
315310
ZoneName: "example.com",
316311
CreatedOn: createdOn,
@@ -408,7 +403,6 @@ func TestListDNSRecordsPagination(t *testing.T) {
408403
assert.Equal(t, expected["proxiable"].(bool), actualRecord.Proxiable)
409404
assert.Equal(t, expected["proxied"].(bool), *actualRecord.Proxied)
410405
assert.Equal(t, int(expected["ttl"].(float64)), actualRecord.TTL)
411-
assert.Equal(t, expected["locked"].(bool), actualRecord.Locked)
412406
assert.Equal(t, expected["zone_id"].(string), actualRecord.ZoneID)
413407
assert.Equal(t, expected["zone_name"].(string), actualRecord.ZoneName)
414408
assert.Equal(t, expected["data"], actualRecord.Data)
@@ -436,7 +430,6 @@ func TestGetDNSRecord(t *testing.T) {
436430
"proxiable": true,
437431
"proxied": false,
438432
"ttl": 120,
439-
"locked": false,
440433
"zone_id": "d56084adb405e0b7e32c52321bf07be6",
441434
"zone_name": "example.com",
442435
"created_on": "2014-01-01T05:20:00Z",
@@ -528,7 +521,6 @@ func TestUpdateDNSRecord(t *testing.T) {
528521
"proxiable": true,
529522
"proxied": false,
530523
"ttl": 120,
531-
"locked": false,
532524
"zone_id": "d56084adb405e0b7e32c52321bf07be6",
533525
"zone_name": "example.com",
534526
"created_on": "2014-01-01T05:20:00Z",
@@ -594,7 +586,6 @@ func TestUpdateDNSRecord_ClearComment(t *testing.T) {
594586
"proxiable": true,
595587
"proxied": false,
596588
"ttl": 120,
597-
"locked": false,
598589
"zone_id": "d56084adb405e0b7e32c52321bf07be6",
599590
"zone_name": "example.com",
600591
"created_on": "2014-01-01T05:20:00Z",
@@ -651,7 +642,6 @@ func TestUpdateDNSRecord_KeepComment(t *testing.T) {
651642
"proxiable": true,
652643
"proxied": false,
653644
"ttl": 120,
654-
"locked": false,
655645
"zone_id": "d56084adb405e0b7e32c52321bf07be6",
656646
"zone_name": "example.com",
657647
"created_on": "2014-01-01T05:20:00Z",

testdata/fixtures/dns/list_page_1.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
"proxiable": true,
1212
"proxied": true,
1313
"ttl": 120,
14-
"locked": false,
1514
"zone_id": "d56084adb405e0b7e32c52321bf07be6",
1615
"zone_name": "example.com",
1716
"created_on": "2014-01-01T05:20:00Z",
@@ -34,7 +33,6 @@
3433
"proxiable": true,
3534
"proxied": false,
3635
"ttl": 120,
37-
"locked": false,
3836
"zone_id": "d56084adb405e0b7e32c52321bf07be6",
3937
"zone_name": "example.com",
4038
"created_on": "2014-01-01T05:20:00Z",
@@ -57,7 +55,6 @@
5755
"proxiable": true,
5856
"proxied": true,
5957
"ttl": 120,
60-
"locked": false,
6158
"zone_id": "d56084adb405e0b7e32c52321bf07be6",
6259
"zone_name": "example.com",
6360
"created_on": "2014-01-01T05:20:00Z",

testdata/fixtures/dns/list_page_2.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
"proxiable": true,
1212
"proxied": false,
1313
"ttl": 120,
14-
"locked": false,
1514
"zone_id": "d56084adb405e0b7e32c52321bf07be6",
1615
"zone_name": "example.com",
1716
"created_on": "2014-01-01T05:20:00Z",
@@ -34,7 +33,6 @@
3433
"proxiable": true,
3534
"proxied": false,
3635
"ttl": 120,
37-
"locked": false,
3836
"zone_id": "d56084adb405e0b7e32c52321bf07be6",
3937
"zone_name": "example.com",
4038
"created_on": "2014-01-01T05:20:00Z",

0 commit comments

Comments
 (0)