Skip to content

Commit 6fdd60f

Browse files
authored
feat(lb): add support for match-subdomains (#4558)
1 parent a273e93 commit 6fdd60f

File tree

6 files changed

+31
-13
lines changed

6 files changed

+31
-13
lines changed

cmd/scw/testdata/test-all-usage-lb-route-create-usage.golden

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,12 @@ USAGE:
66
scw lb route create [arg=value ...]
77

88
ARGS:
9-
[frontend-id] ID of the source frontend to create the route on
10-
[backend-id] ID of the target backend for the route
11-
[match.sni] Server Name Indication (SNI) value to match
12-
[match.host-header] HTTP host header to match
13-
[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 | nl-ams-3 | pl-waw-1 | pl-waw-2 | pl-waw-3)
9+
[frontend-id] ID of the source frontend to create the route on
10+
[backend-id] ID of the target backend for the route
11+
[match.sni] Server Name Indication (SNI) value to match
12+
[match.host-header] HTTP host header to match
13+
[match.match-subdomains] If true, all subdomains will match
14+
[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 | nl-ams-3 | pl-waw-1 | pl-waw-2 | pl-waw-3)
1415

1516
FLAGS:
1617
-h, --help help for create

cmd/scw/testdata/test-all-usage-lb-route-update-usage.golden

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

88
ARGS:
9-
route-id Route ID
10-
[backend-id] ID of the target backend for the route
11-
[match.sni] Server Name Indication (SNI) value to match
12-
[match.host-header] HTTP host header to match
13-
[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 | nl-ams-3 | pl-waw-1 | pl-waw-2 | pl-waw-3)
9+
route-id Route ID
10+
[backend-id] ID of the target backend for the route
11+
[match.sni] Server Name Indication (SNI) value to match
12+
[match.host-header] HTTP host header to match
13+
[match.match-subdomains] If true, all subdomains will match
14+
[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 | nl-ams-3 | pl-waw-1 | pl-waw-2 | pl-waw-3)
1415

1516
FLAGS:
1617
-h, --help help for update

docs/commands/lb.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1203,6 +1203,7 @@ scw lb route create [arg=value ...]
12031203
| backend-id | | ID of the target backend for the route |
12041204
| match.sni | | Server Name Indication (SNI) value to match |
12051205
| match.host-header | | HTTP host header to match |
1206+
| match.match-subdomains | | If true, all subdomains will match |
12061207
| zone | Default: `fr-par-1`<br />One of: `fr-par-1`, `fr-par-2`, `nl-ams-1`, `nl-ams-2`, `nl-ams-3`, `pl-waw-1`, `pl-waw-2`, `pl-waw-3` | Zone to target. If none is passed will use default zone from the config |
12071208

12081209

@@ -1287,6 +1288,7 @@ scw lb route update <route-id ...> [arg=value ...]
12871288
| backend-id | | ID of the target backend for the route |
12881289
| match.sni | | Server Name Indication (SNI) value to match |
12891290
| match.host-header | | HTTP host header to match |
1291+
| match.match-subdomains | | If true, all subdomains will match |
12901292
| zone | Default: `fr-par-1`<br />One of: `fr-par-1`, `fr-par-2`, `nl-ams-1`, `nl-ams-2`, `nl-ams-3`, `pl-waw-1`, `pl-waw-2`, `pl-waw-3` | Zone to target. If none is passed will use default zone from the config |
12911293

12921294

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.20250226161447-7f3ec4e202c0
28+
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.32.0.20250227160344-4d0065cc52da
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.20250226161447-7f3ec4e202c0 h1:kntbxbL0kHhAqrVvirdezoXqDjCPWb47XWYPWH8v6k8=
462-
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.32.0.20250226161447-7f3ec4e202c0/go.mod h1:792k1RTU+5JeMXm35/e2Wgp71qPH/DmDoZrRc+EFZDk=
461+
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.32.0.20250227160344-4d0065cc52da h1:2l4es/nkKYzsuMQl4JnrJDBCZKM+yfBzVlr5SpuajaU=
462+
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.32.0.20250227160344-4d0065cc52da/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/lb/v1/lb_cli.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1979,6 +1979,13 @@ func lbRouteCreate() *core.Command {
19791979
Deprecated: false,
19801980
Positional: false,
19811981
},
1982+
{
1983+
Name: "match.match-subdomains",
1984+
Short: `If true, all subdomains will match`,
1985+
Required: false,
1986+
Deprecated: false,
1987+
Positional: false,
1988+
},
19821989
core.ZoneArgSpec(scw.ZoneFrPar1, scw.ZoneFrPar2, scw.ZoneNlAms1, scw.ZoneNlAms2, scw.ZoneNlAms3, scw.ZonePlWaw1, scw.ZonePlWaw2, scw.ZonePlWaw3),
19831990
},
19841991
Run: func(ctx context.Context, args interface{}) (i interface{}, e error) {
@@ -2060,6 +2067,13 @@ func lbRouteUpdate() *core.Command {
20602067
Deprecated: false,
20612068
Positional: false,
20622069
},
2070+
{
2071+
Name: "match.match-subdomains",
2072+
Short: `If true, all subdomains will match`,
2073+
Required: false,
2074+
Deprecated: false,
2075+
Positional: false,
2076+
},
20632077
core.ZoneArgSpec(scw.ZoneFrPar1, scw.ZoneFrPar2, scw.ZoneNlAms1, scw.ZoneNlAms2, scw.ZoneNlAms3, scw.ZonePlWaw1, scw.ZonePlWaw2, scw.ZonePlWaw3),
20642078
},
20652079
Run: func(ctx context.Context, args interface{}) (i interface{}, e error) {

0 commit comments

Comments
 (0)