Skip to content

Commit 97ce908

Browse files
feat(ipam): allow publicly to set a custom reverse on their ip (#3576)
Co-authored-by: Jules Casteran <[email protected]>
1 parent 1317e5f commit 97ce908

File tree

5 files changed

+24
-6
lines changed

5 files changed

+24
-6
lines changed

cmd/scw/testdata/test-all-usage-ipam-ip-update-usage.golden

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,11 @@ USAGE:
66
scw ipam ip update <ip-id ...> [arg=value ...]
77

88
ARGS:
9-
ip-id IP ID
10-
[tags.{index}] Tags for the IP
11-
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | nl-ams | pl-waw)
9+
ip-id IP ID
10+
[tags.{index}] Tags for the IP
11+
[reverses.{index}.hostname] Reverse domain name
12+
[reverses.{index}.address] IP corresponding to the hostname
13+
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | nl-ams | pl-waw)
1214

1315
FLAGS:
1416
-h, --help help for update

docs/commands/ipam.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,8 @@ scw ipam ip update <ip-id ...> [arg=value ...]
129129
|------|---|-------------|
130130
| ip-id | Required | IP ID |
131131
| tags.{index} | | Tags for the IP |
132+
| reverses.{index}.hostname | | Reverse domain name |
133+
| reverses.{index}.address | | IP corresponding to the hostname |
132134
| 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 |
133135

134136

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ require (
2424
github.com/moby/buildkit v0.11.6
2525
github.com/opencontainers/go-digest v1.0.0
2626
github.com/pkg/errors v0.9.1
27-
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.22.0.20231218165754-3df218ee7906
27+
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.22.0.20231226091813-d6e72a6ef4e9
2828
github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966
2929
github.com/spf13/cobra v1.8.0
3030
github.com/spf13/pflag v1.0.5

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -386,8 +386,8 @@ github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDN
386386
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
387387
github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06 h1:OkMGxebDjyw0ULyrTYWeN0UNCCkmCWfjPnIA2W6oviI=
388388
github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06/go.mod h1:+ePHsJ1keEjQtpvf9HHw0f4ZeJ0TLRsxhunSI2hYJSs=
389-
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.22.0.20231218165754-3df218ee7906 h1:gr6tscWzcaLyp9BKnPNcaIlMpj9LHuavTbxQ3i2Cedo=
390-
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.22.0.20231218165754-3df218ee7906/go.mod h1:fCa7OJZ/9DRTnOKmxvT6pn+LPWUptQAmHF/SBJUGEcg=
389+
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.22.0.20231226091813-d6e72a6ef4e9 h1:1exQLcwPxDo+fTDZl+iqlIvx3lJRlad0US4mX8Coq5M=
390+
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.22.0.20231226091813-d6e72a6ef4e9/go.mod h1:fCa7OJZ/9DRTnOKmxvT6pn+LPWUptQAmHF/SBJUGEcg=
391391
github.com/sclevine/spec v1.4.0 h1:z/Q9idDcay5m5irkZ28M7PtQM4aOISzOpj4bUPkDee8=
392392
github.com/secure-systems-lab/go-securesystemslib v0.4.0 h1:b23VGrQhTA8cN2CbBw7/FulN9fTtqYUdS5+Oxzt+DUE=
393393
github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo=

internal/namespaces/ipam/v1/ipam_cli.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,20 @@ func ipamIPUpdate() *core.Command {
201201
Deprecated: false,
202202
Positional: false,
203203
},
204+
{
205+
Name: "reverses.{index}.hostname",
206+
Short: `Reverse domain name`,
207+
Required: false,
208+
Deprecated: false,
209+
Positional: false,
210+
},
211+
{
212+
Name: "reverses.{index}.address",
213+
Short: `IP corresponding to the hostname`,
214+
Required: false,
215+
Deprecated: false,
216+
Positional: false,
217+
},
204218
core.RegionArgSpec(scw.RegionFrPar, scw.RegionNlAms, scw.RegionPlWaw),
205219
},
206220
Run: func(ctx context.Context, args interface{}) (i interface{}, e error) {

0 commit comments

Comments
 (0)