Skip to content

Commit e8c3eda

Browse files
authored
feat(webhosting): replace domain conf options (#4583)
1 parent c0d1734 commit e8c3eda

File tree

6 files changed

+97
-23
lines changed

6 files changed

+97
-23
lines changed

cmd/scw/testdata/test-all-usage-webhosting-domain-sync-dns-records-usage.golden

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,20 @@ USAGE:
66
scw webhosting domain sync-dns-records [arg=value ...]
77

88
ARGS:
9-
domain Domain for which the DNS records will be synchronized.
10-
[update-web-records] Whether or not to synchronize the web records.
11-
[update-mail-records] Whether or not to synchronize the mail records.
12-
[update-all-records] Whether or not to synchronize all types of records. This one has priority.
13-
[update-nameservers] Whether or not to synchronize domain nameservers.
14-
[custom-records.{index}.name]
15-
[custom-records.{index}.type] (unknown_type | a | cname | mx | txt | ns | aaaa)
16-
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | nl-ams | pl-waw)
9+
domain Domain for which the DNS records will be synchronized.
10+
[custom-records.{index}.name]
11+
[custom-records.{index}.type] (unknown_type | a | cname | mx | txt | ns | aaaa)
12+
[auto-config-domain-dns.nameservers] Whether or not to synchronize domain nameservers.
13+
[auto-config-domain-dns.web-records] Whether or not to synchronize web records.
14+
[auto-config-domain-dns.mail-records] Whether or not to synchronize mail records.
15+
[auto-config-domain-dns.all-records] Whether or not to synchronize all types of records. Takes priority over the other fields.
16+
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | nl-ams | pl-waw)
17+
18+
DEPRECATED ARGS:
19+
[update-web-records] Whether or not to synchronize the web records (deprecated, use auto_config_domain_dns).
20+
[update-mail-records] Whether or not to synchronize the mail records (deprecated, use auto_config_domain_dns).
21+
[update-all-records] Whether or not to synchronize all types of records. This one has priority (deprecated, use auto_config_domain_dns).
22+
[update-nameservers] Whether or not to synchronize domain nameservers (deprecated, use auto_config_domain_dns).
1723

1824
FLAGS:
1925
-h, --help help for sync-dns-records

cmd/scw/testdata/test-all-usage-webhosting-hosting-create-usage.golden

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ ARGS:
1919
[domain-configuration.update-mail-record]
2020
[domain-configuration.update-all-records]
2121
[skip-welcome-email] Indicates whether to skip a welcome email to the contact email containing hosting info.
22+
[auto-config-domain-dns.nameservers] Whether or not to synchronize domain nameservers.
23+
[auto-config-domain-dns.web-records] Whether or not to synchronize web records.
24+
[auto-config-domain-dns.mail-records] Whether or not to synchronize mail records.
25+
[auto-config-domain-dns.all-records] Whether or not to synchronize all types of records. Takes priority over the other fields.
2226
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | nl-ams | pl-waw)
2327

2428
FLAGS:

docs/commands/webhosting.md

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -393,12 +393,16 @@ scw webhosting domain sync-dns-records [arg=value ...]
393393
| Name | | Description |
394394
|------|---|-------------|
395395
| domain | Required | Domain for which the DNS records will be synchronized. |
396-
| update-web-records | | Whether or not to synchronize the web records. |
397-
| update-mail-records | | Whether or not to synchronize the mail records. |
398-
| update-all-records | | Whether or not to synchronize all types of records. This one has priority. |
399-
| update-nameservers | | Whether or not to synchronize domain nameservers. |
396+
| ~~update-web-records~~ | Deprecated | Whether or not to synchronize the web records (deprecated, use auto_config_domain_dns). |
397+
| ~~update-mail-records~~ | Deprecated | Whether or not to synchronize the mail records (deprecated, use auto_config_domain_dns). |
398+
| ~~update-all-records~~ | Deprecated | Whether or not to synchronize all types of records. This one has priority (deprecated, use auto_config_domain_dns). |
399+
| ~~update-nameservers~~ | Deprecated | Whether or not to synchronize domain nameservers (deprecated, use auto_config_domain_dns). |
400400
| custom-records.{index}.name | | |
401401
| custom-records.{index}.type | One of: `unknown_type`, `a`, `cname`, `mx`, `txt`, `ns`, `aaaa` | |
402+
| auto-config-domain-dns.nameservers | | Whether or not to synchronize domain nameservers. |
403+
| auto-config-domain-dns.web-records | | Whether or not to synchronize web records. |
404+
| auto-config-domain-dns.mail-records | | Whether or not to synchronize mail records. |
405+
| auto-config-domain-dns.all-records | | Whether or not to synchronize all types of records. Takes priority over the other fields. |
402406
| region | Default: `fr-par`<br />One of: `fr-par`, `nl-ams`, `pl-waw` | Region to target. If none is passed will use default region from the config |
403407

404408

@@ -507,6 +511,10 @@ scw webhosting hosting create [arg=value ...]
507511
| domain-configuration.update-mail-record | | |
508512
| domain-configuration.update-all-records | | |
509513
| skip-welcome-email | | Indicates whether to skip a welcome email to the contact email containing hosting info. |
514+
| auto-config-domain-dns.nameservers | | Whether or not to synchronize domain nameservers. |
515+
| auto-config-domain-dns.web-records | | Whether or not to synchronize web records. |
516+
| auto-config-domain-dns.mail-records | | Whether or not to synchronize mail records. |
517+
| auto-config-domain-dns.all-records | | Whether or not to synchronize all types of records. Takes priority over the other fields. |
510518
| region | Default: `fr-par`<br />One of: `fr-par`, `nl-ams`, `pl-waw` | Region to target. If none is passed will use default region from the config |
511519

512520

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ require (
2525
github.com/mattn/go-isatty v0.0.20
2626
github.com/moby/buildkit v0.13.2
2727
github.com/opencontainers/go-digest v1.0.0
28-
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.32.0.20250312091247-697a13a38e06
28+
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.32.0.20250312144558-0af04b4e364d
2929
github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966
3030
github.com/spf13/cobra v1.9.1
3131
github.com/spf13/pflag v1.0.6

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -458,8 +458,8 @@ github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUz
458458
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
459459
github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06 h1:OkMGxebDjyw0ULyrTYWeN0UNCCkmCWfjPnIA2W6oviI=
460460
github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06/go.mod h1:+ePHsJ1keEjQtpvf9HHw0f4ZeJ0TLRsxhunSI2hYJSs=
461-
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.32.0.20250312091247-697a13a38e06 h1:SHt9tWyql2MPgr9f2sCgcLNhiWsGHMjGwePXQBAas38=
462-
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.32.0.20250312091247-697a13a38e06/go.mod h1:792k1RTU+5JeMXm35/e2Wgp71qPH/DmDoZrRc+EFZDk=
461+
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.32.0.20250312144558-0af04b4e364d h1:crcNANqcAyq7wm80ySMUew10by466BZP57FWCMo8KVw=
462+
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.32.0.20250312144558-0af04b4e364d/go.mod h1:792k1RTU+5JeMXm35/e2Wgp71qPH/DmDoZrRc+EFZDk=
463463
github.com/sclevine/spec v1.4.0 h1:z/Q9idDcay5m5irkZ28M7PtQM4aOISzOpj4bUPkDee8=
464464
github.com/sclevine/spec v1.4.0/go.mod h1:LvpgJaFyvQzRvc1kaDs0bulYwzC70PbiYjC4QnFHkOM=
465465
github.com/secure-systems-lab/go-securesystemslib v0.8.0 h1:mr5An6X45Kb2nddcFlbmfHkLguCE9laoZCUzEEpIZXA=

internal/namespaces/webhosting/v1/webhosting_cli.go

Lines changed: 64 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -752,30 +752,30 @@ func webhostingDomainSyncDNSRecords() *core.Command {
752752
},
753753
{
754754
Name: "update-web-records",
755-
Short: `Whether or not to synchronize the web records.`,
755+
Short: `Whether or not to synchronize the web records (deprecated, use auto_config_domain_dns).`,
756756
Required: false,
757-
Deprecated: false,
757+
Deprecated: true,
758758
Positional: false,
759759
},
760760
{
761761
Name: "update-mail-records",
762-
Short: `Whether or not to synchronize the mail records.`,
762+
Short: `Whether or not to synchronize the mail records (deprecated, use auto_config_domain_dns).`,
763763
Required: false,
764-
Deprecated: false,
764+
Deprecated: true,
765765
Positional: false,
766766
},
767767
{
768768
Name: "update-all-records",
769-
Short: `Whether or not to synchronize all types of records. This one has priority.`,
769+
Short: `Whether or not to synchronize all types of records. This one has priority (deprecated, use auto_config_domain_dns).`,
770770
Required: false,
771-
Deprecated: false,
771+
Deprecated: true,
772772
Positional: false,
773773
},
774774
{
775775
Name: "update-nameservers",
776-
Short: `Whether or not to synchronize domain nameservers.`,
776+
Short: `Whether or not to synchronize domain nameservers (deprecated, use auto_config_domain_dns).`,
777777
Required: false,
778-
Deprecated: false,
778+
Deprecated: true,
779779
Positional: false,
780780
},
781781
{
@@ -791,6 +791,34 @@ func webhostingDomainSyncDNSRecords() *core.Command {
791791
Positional: false,
792792
EnumValues: []string{"unknown_type", "a", "cname", "mx", "txt", "ns", "aaaa"},
793793
},
794+
{
795+
Name: "auto-config-domain-dns.nameservers",
796+
Short: `Whether or not to synchronize domain nameservers.`,
797+
Required: false,
798+
Deprecated: false,
799+
Positional: false,
800+
},
801+
{
802+
Name: "auto-config-domain-dns.web-records",
803+
Short: `Whether or not to synchronize web records.`,
804+
Required: false,
805+
Deprecated: false,
806+
Positional: false,
807+
},
808+
{
809+
Name: "auto-config-domain-dns.mail-records",
810+
Short: `Whether or not to synchronize mail records.`,
811+
Required: false,
812+
Deprecated: false,
813+
Positional: false,
814+
},
815+
{
816+
Name: "auto-config-domain-dns.all-records",
817+
Short: `Whether or not to synchronize all types of records. Takes priority over the other fields.`,
818+
Required: false,
819+
Deprecated: false,
820+
Positional: false,
821+
},
794822
core.RegionArgSpec(scw.RegionFrPar, scw.RegionNlAms, scw.RegionPlWaw),
795823
},
796824
Run: func(ctx context.Context, args interface{}) (i interface{}, e error) {
@@ -950,6 +978,34 @@ func webhostingHostingCreate() *core.Command {
950978
Deprecated: false,
951979
Positional: false,
952980
},
981+
{
982+
Name: "auto-config-domain-dns.nameservers",
983+
Short: `Whether or not to synchronize domain nameservers.`,
984+
Required: false,
985+
Deprecated: false,
986+
Positional: false,
987+
},
988+
{
989+
Name: "auto-config-domain-dns.web-records",
990+
Short: `Whether or not to synchronize web records.`,
991+
Required: false,
992+
Deprecated: false,
993+
Positional: false,
994+
},
995+
{
996+
Name: "auto-config-domain-dns.mail-records",
997+
Short: `Whether or not to synchronize mail records.`,
998+
Required: false,
999+
Deprecated: false,
1000+
Positional: false,
1001+
},
1002+
{
1003+
Name: "auto-config-domain-dns.all-records",
1004+
Short: `Whether or not to synchronize all types of records. Takes priority over the other fields.`,
1005+
Required: false,
1006+
Deprecated: false,
1007+
Positional: false,
1008+
},
9531009
core.RegionArgSpec(scw.RegionFrPar, scw.RegionNlAms, scw.RegionPlWaw),
9541010
},
9551011
Run: func(ctx context.Context, args interface{}) (i interface{}, e error) {

0 commit comments

Comments
 (0)