Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ipam): allow publicly to set a custom reverse on their ip #3576

Merged
merged 2 commits into from
Dec 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions cmd/scw/testdata/test-all-usage-ipam-ip-update-usage.golden
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@ USAGE:
scw ipam ip update <ip-id ...> [arg=value ...]

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

FLAGS:
-h, --help help for update
Expand Down
2 changes: 2 additions & 0 deletions docs/commands/ipam.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,8 @@ scw ipam ip update <ip-id ...> [arg=value ...]
|------|---|-------------|
| ip-id | Required | IP ID |
| tags.{index} | | Tags for the IP |
| reverses.{index}.hostname | | Reverse domain name |
| reverses.{index}.address | | IP corresponding to the hostname |
| 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 |


Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ require (
github.com/moby/buildkit v0.11.6
github.com/opencontainers/go-digest v1.0.0
github.com/pkg/errors v0.9.1
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.22.0.20231218165754-3df218ee7906
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.22.0.20231226091813-d6e72a6ef4e9
github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966
github.com/spf13/cobra v1.8.0
github.com/spf13/pflag v1.0.5
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -386,8 +386,8 @@ github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDN
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06 h1:OkMGxebDjyw0ULyrTYWeN0UNCCkmCWfjPnIA2W6oviI=
github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06/go.mod h1:+ePHsJ1keEjQtpvf9HHw0f4ZeJ0TLRsxhunSI2hYJSs=
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.22.0.20231218165754-3df218ee7906 h1:gr6tscWzcaLyp9BKnPNcaIlMpj9LHuavTbxQ3i2Cedo=
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.22.0.20231218165754-3df218ee7906/go.mod h1:fCa7OJZ/9DRTnOKmxvT6pn+LPWUptQAmHF/SBJUGEcg=
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.22.0.20231226091813-d6e72a6ef4e9 h1:1exQLcwPxDo+fTDZl+iqlIvx3lJRlad0US4mX8Coq5M=
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.22.0.20231226091813-d6e72a6ef4e9/go.mod h1:fCa7OJZ/9DRTnOKmxvT6pn+LPWUptQAmHF/SBJUGEcg=
github.com/sclevine/spec v1.4.0 h1:z/Q9idDcay5m5irkZ28M7PtQM4aOISzOpj4bUPkDee8=
github.com/secure-systems-lab/go-securesystemslib v0.4.0 h1:b23VGrQhTA8cN2CbBw7/FulN9fTtqYUdS5+Oxzt+DUE=
github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo=
Expand Down
14 changes: 14 additions & 0 deletions internal/namespaces/ipam/v1/ipam_cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,20 @@ func ipamIPUpdate() *core.Command {
Deprecated: false,
Positional: false,
},
{
Name: "reverses.{index}.hostname",
Short: `Reverse domain name`,
Required: false,
Deprecated: false,
Positional: false,
},
{
Name: "reverses.{index}.address",
Short: `IP corresponding to the hostname`,
Required: false,
Deprecated: false,
Positional: false,
},
core.RegionArgSpec(scw.RegionFrPar, scw.RegionNlAms, scw.RegionPlWaw),
},
Run: func(ctx context.Context, args interface{}) (i interface{}, e error) {
Expand Down
Loading