Skip to content

Commit 4ba865d

Browse files
authored
fix(dns): consistent TTL on records across the devtools (#2765)
1 parent 2b520b9 commit 4ba865d

File tree

6 files changed

+8
-6
lines changed

6 files changed

+8
-6
lines changed

cmd/scw/testdata/test-all-usage-dns-record-add-usage.golden

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ ARGS:
1717
data
1818
[name]
1919
[priority]
20-
ttl=300
20+
ttl=3600
2121
type (A | AAAA | CNAME | TXT | SRV | TLSA | MX | NS | PTR | CAA | ALIAS | LOC | SSHFP | HINFO | RP | URI | DS | NAPTR)
2222
[comment]
2323
[geo-ip-config.matches.{index}.countries.{index}]

cmd/scw/testdata/test-all-usage-dns-record-set-usage.golden

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ ARGS:
1717
values.{index} A list of values for replacing the record data. (multiple values cannot be used for all type)
1818
name
1919
[priority]
20-
ttl=300
20+
ttl=3600
2121
type (A | AAAA | CNAME | TXT | SRV | TLSA | MX | NS | PTR | CAA | ALIAS | LOC | SSHFP | HINFO | RP | URI | DS | NAPTR)
2222
[comment]
2323
[geo-ip-config.matches.{index}.countries.{index}]

docs/commands/dns.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ scw dns record add <dns-zone ...> [arg=value ...]
142142
| data | Required | |
143143
| name | | |
144144
| priority | | |
145-
| ttl | Required<br />Default: `300` | |
145+
| ttl | Required<br />Default: `3600` | |
146146
| type | Required<br />One of: `A`, `AAAA`, `CNAME`, `TXT`, `SRV`, `TLSA`, `MX`, `NS`, `PTR`, `CAA`, `ALIAS`, `LOC`, `SSHFP`, `HINFO`, `RP`, `URI`, `DS`, `NAPTR` | |
147147
| comment | | |
148148
| geo-ip-config.matches.{index}.countries.{index} | | |
@@ -390,7 +390,7 @@ scw dns record set <dns-zone ...> [arg=value ...]
390390
| values.{index} | Required | A list of values for replacing the record data. (multiple values cannot be used for all type) |
391391
| name | Required | |
392392
| priority | | |
393-
| ttl | Required<br />Default: `300` | |
393+
| ttl | Required<br />Default: `3600` | |
394394
| type | Required<br />One of: `A`, `AAAA`, `CNAME`, `TXT`, `SRV`, `TLSA`, `MX`, `NS`, `PTR`, `CAA`, `ALIAS`, `LOC`, `SSHFP`, `HINFO`, `RP`, `URI`, `DS`, `NAPTR` | |
395395
| comment | | |
396396
| geo-ip-config.matches.{index}.countries.{index} | | |

internal/namespaces/domain/v2beta1/custom_record_add.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ func dnsRecordAddCommand() *core.Command {
5151
Required: true,
5252
Deprecated: false,
5353
Positional: false,
54-
Default: core.DefaultValueSetter("300"),
54+
Default: core.DefaultValueSetter(defaultTTL),
5555
},
5656
{
5757
Name: "type",

internal/namespaces/domain/v2beta1/custom_record_set.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ func dnsRecordSetCommand() *core.Command {
5454
Required: true,
5555
Deprecated: false,
5656
Positional: false,
57-
Default: core.DefaultValueSetter("300"),
57+
Default: core.DefaultValueSetter(defaultTTL),
5858
},
5959
{
6060
Name: "type",

internal/namespaces/domain/v2beta1/domain_cli.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ var (
1717
_ = scw.RegionFrPar
1818
)
1919

20+
const defaultTTL = "3600"
21+
2022
func GetGeneratedCommands() *core.Commands {
2123
return core.NewCommands(
2224
dnsRoot(),

0 commit comments

Comments
 (0)