Skip to content

Commit a14ec77

Browse files
feat(lb): add support for is ipv6 (#3171)
Co-authored-by: Rémy Léone <[email protected]>
1 parent a41fc4e commit a14ec77

File tree

6 files changed

+34
-5
lines changed

6 files changed

+34
-5
lines changed

cmd/scw/testdata/test-all-usage-lbip-create-usage.golden

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ USAGE:
88
ARGS:
99
[project-id] Project ID to use. If none is passed the default project ID will be used
1010
[reverse] Reverse DNS (domain name) for the IP address
11+
[is-ipv6] If true, creates a Flexible IP with an ipv6 address
1112
[organization-id] Organization ID to use. If none is passed the default organization ID will be used
1213
[zone=fr-par-1] Zone to target. If none is passed will use default zone from the config (fr-par-1 | fr-par-2 | nl-ams-1 | nl-ams-2 | pl-waw-1 | pl-waw-2)
1314

cmd/scw/testdata/test-all-usage-lblb-create-usage.golden

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,18 @@ ARGS:
99
[project-id] Project ID to use. If none is passed the default project ID will be used
1010
name=<generated> Name for the Load Balancer
1111
[description] Description for the Load Balancer
12-
[ip-id] ID of an existing flexible IP address to attach to the Load Balancer
12+
[assign-flexible-ip] Defines whether to automatically assign a flexible public IP to lb. Default value is `false` (do not assign).
13+
[ip-ids.{index}] List of IP IDs to attach to the Load Balancer
1314
[assign-flexible-ip] Defines whether to automatically assign a flexible public IP to lb. Default value is `false` (do not assign).
1415
[tags.{index}] List of tags for the Load Balancer
1516
[type=LB-S] Load Balancer commercial offer type. Use the Load Balancer types endpoint to retrieve a list of available offer types (LB-S | LB-GP-M | LB-GP-L)
1617
[ssl-compatibility-level] Determines the minimal SSL version which needs to be supported on the client side, in an SSL/TLS offloading context. Intermediate is suitable for general-purpose servers with a variety of clients, recommended for almost all systems. Modern is suitable for services with clients that support TLS 1.3 and do not need backward compatibility. Old is compatible with a small number of very old clients and should be used only as a last resort (ssl_compatibility_level_unknown | ssl_compatibility_level_intermediate | ssl_compatibility_level_modern | ssl_compatibility_level_old)
1718
[organization-id] Organization ID to use. If none is passed the default organization ID will be used
1819
[zone=fr-par-1] Zone to target. If none is passed will use default zone from the config (fr-par-1 | fr-par-2 | nl-ams-1 | nl-ams-2 | pl-waw-1 | pl-waw-2)
1920

21+
DEPRECATED ARGS:
22+
[ip-id] ID of an existing flexible IP address to attach to the Load Balancer
23+
2024
FLAGS:
2125
-h, --help help for create
2226
-w, --wait wait until the lb is ready

docs/commands/lb.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -788,6 +788,7 @@ scw lb ip create [arg=value ...]
788788
|------|---|-------------|
789789
| project-id | | Project ID to use. If none is passed the default project ID will be used |
790790
| reverse | | Reverse DNS (domain name) for the IP address |
791+
| is-ipv6 | | If true, creates a Flexible IP with an ipv6 address |
791792
| organization-id | | Organization ID to use. If none is passed the default organization ID will be used |
792793
| zone | Default: `fr-par-1`<br />One of: `fr-par-1`, `fr-par-2`, `nl-ams-1`, `nl-ams-2`, `pl-waw-1`, `pl-waw-2` | Zone to target. If none is passed will use default zone from the config |
793794

@@ -899,7 +900,9 @@ scw lb lb create [arg=value ...]
899900
| project-id | | Project ID to use. If none is passed the default project ID will be used |
900901
| name | Required<br />Default: `<generated>` | Name for the Load Balancer |
901902
| description | | Description for the Load Balancer |
902-
| ip-id | | ID of an existing flexible IP address to attach to the Load Balancer |
903+
| ~~ip-id~~ | Deprecated | ID of an existing flexible IP address to attach to the Load Balancer |
904+
| assign-flexible-ip | | Defines whether to automatically assign a flexible public IP to lb. Default value is `false` (do not assign). |
905+
| ip-ids.{index} | | List of IP IDs to attach to the Load Balancer |
903906
| assign-flexible-ip | | Defines whether to automatically assign a flexible public IP to lb. Default value is `false` (do not assign). |
904907
| tags.{index} | | List of tags for the Load Balancer |
905908
| type | Default: `LB-S`<br />One of: `LB-S`, `LB-GP-M`, `LB-GP-L` | Load Balancer commercial offer type. Use the Load Balancer types endpoint to retrieve a list of available offer types |

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ 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.17.0.20230605161902-063dd98719c5
2728
github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966
28-
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.17.0.20230601085652-73d98e0bd94d
2929
github.com/spf13/cobra v1.7.0
3030
github.com/spf13/pflag v1.0.5
3131
github.com/stretchr/testify v1.8.4

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -499,8 +499,8 @@ github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncj
499499
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
500500
github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06 h1:OkMGxebDjyw0ULyrTYWeN0UNCCkmCWfjPnIA2W6oviI=
501501
github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06/go.mod h1:+ePHsJ1keEjQtpvf9HHw0f4ZeJ0TLRsxhunSI2hYJSs=
502-
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.17.0.20230601085652-73d98e0bd94d h1:T90r5KjFup0Gtbn/WnvmwWEjiq8sKwMdMZcW/rYA2wk=
503-
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.17.0.20230601085652-73d98e0bd94d/go.mod h1:fCa7OJZ/9DRTnOKmxvT6pn+LPWUptQAmHF/SBJUGEcg=
502+
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.17.0.20230605161902-063dd98719c5 h1:cvEzMB3pnmV7nz/UL8otnJkuQ6HZ9JtkB03REanoWPE=
503+
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.17.0.20230605161902-063dd98719c5/go.mod h1:fCa7OJZ/9DRTnOKmxvT6pn+LPWUptQAmHF/SBJUGEcg=
504504
github.com/sclevine/spec v1.4.0 h1:z/Q9idDcay5m5irkZ28M7PtQM4aOISzOpj4bUPkDee8=
505505
github.com/secure-systems-lab/go-securesystemslib v0.4.0 h1:b23VGrQhTA8cN2CbBw7/FulN9fTtqYUdS5+Oxzt+DUE=
506506
github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo=

internal/namespaces/lb/v1/lb_cli.go

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,20 @@ func lbLBCreate() *core.Command {
275275
Name: "ip-id",
276276
Short: `ID of an existing flexible IP address to attach to the Load Balancer`,
277277
Required: false,
278+
Deprecated: true,
279+
Positional: false,
280+
},
281+
{
282+
Name: "assign-flexible-ip",
283+
Short: `Defines whether to automatically assign a flexible public IP to lb. Default value is ` + "`" + `false` + "`" + ` (do not assign).`,
284+
Required: false,
285+
Deprecated: false,
286+
Positional: false,
287+
},
288+
{
289+
Name: "ip-ids.{index}",
290+
Short: `List of IP IDs to attach to the Load Balancer`,
291+
Required: false,
278292
Deprecated: false,
279293
Positional: false,
280294
},
@@ -561,6 +575,13 @@ func lbIPCreate() *core.Command {
561575
Deprecated: false,
562576
Positional: false,
563577
},
578+
{
579+
Name: "is-ipv6",
580+
Short: `If true, creates a Flexible IP with an ipv6 address`,
581+
Required: false,
582+
Deprecated: false,
583+
Positional: false,
584+
},
564585
core.OrganizationIDArgSpec(),
565586
core.ZoneArgSpec(scw.ZoneFrPar1, scw.ZoneFrPar2, scw.ZoneNlAms1, scw.ZoneNlAms2, scw.ZonePlWaw1, scw.ZonePlWaw2),
566587
},

0 commit comments

Comments
 (0)