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(lb): add support for match-subdomains #4558

Merged
merged 1 commit into from
Feb 28, 2025
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
11 changes: 6 additions & 5 deletions cmd/scw/testdata/test-all-usage-lb-route-create-usage.golden
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ USAGE:
scw lb route create [arg=value ...]

ARGS:
[frontend-id] ID of the source frontend to create the route on
[backend-id] ID of the target backend for the route
[match.sni] Server Name Indication (SNI) value to match
[match.host-header] HTTP host header to match
[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)
[frontend-id] ID of the source frontend to create the route on
[backend-id] ID of the target backend for the route
[match.sni] Server Name Indication (SNI) value to match
[match.host-header] HTTP host header to match
[match.match-subdomains] If true, all subdomains will match
[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)

FLAGS:
-h, --help help for create
Expand Down
11 changes: 6 additions & 5 deletions cmd/scw/testdata/test-all-usage-lb-route-update-usage.golden
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ USAGE:
scw lb route update <route-id ...> [arg=value ...]

ARGS:
route-id Route ID
[backend-id] ID of the target backend for the route
[match.sni] Server Name Indication (SNI) value to match
[match.host-header] HTTP host header to match
[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)
route-id Route ID
[backend-id] ID of the target backend for the route
[match.sni] Server Name Indication (SNI) value to match
[match.host-header] HTTP host header to match
[match.match-subdomains] If true, all subdomains will match
[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)

FLAGS:
-h, --help help for update
Expand Down
2 changes: 2 additions & 0 deletions docs/commands/lb.md
Original file line number Diff line number Diff line change
Expand Up @@ -1203,6 +1203,7 @@ scw lb route create [arg=value ...]
| backend-id | | ID of the target backend for the route |
| match.sni | | Server Name Indication (SNI) value to match |
| match.host-header | | HTTP host header to match |
| match.match-subdomains | | If true, all subdomains will match |
| 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 |


Expand Down Expand Up @@ -1287,6 +1288,7 @@ scw lb route update <route-id ...> [arg=value ...]
| backend-id | | ID of the target backend for the route |
| match.sni | | Server Name Indication (SNI) value to match |
| match.host-header | | HTTP host header to match |
| match.match-subdomains | | If true, all subdomains will match |
| 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 |


Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ require (
github.com/mattn/go-isatty v0.0.20
github.com/moby/buildkit v0.13.2
github.com/opencontainers/go-digest v1.0.0
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.32.0.20250226161447-7f3ec4e202c0
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.32.0.20250227160344-4d0065cc52da
github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966
github.com/spf13/cobra v1.9.1
github.com/spf13/pflag v1.0.6
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -458,8 +458,8 @@ github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUz
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.32.0.20250226161447-7f3ec4e202c0 h1:kntbxbL0kHhAqrVvirdezoXqDjCPWb47XWYPWH8v6k8=
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.32.0.20250226161447-7f3ec4e202c0/go.mod h1:792k1RTU+5JeMXm35/e2Wgp71qPH/DmDoZrRc+EFZDk=
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.32.0.20250227160344-4d0065cc52da h1:2l4es/nkKYzsuMQl4JnrJDBCZKM+yfBzVlr5SpuajaU=
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.32.0.20250227160344-4d0065cc52da/go.mod h1:792k1RTU+5JeMXm35/e2Wgp71qPH/DmDoZrRc+EFZDk=
github.com/sclevine/spec v1.4.0 h1:z/Q9idDcay5m5irkZ28M7PtQM4aOISzOpj4bUPkDee8=
github.com/sclevine/spec v1.4.0/go.mod h1:LvpgJaFyvQzRvc1kaDs0bulYwzC70PbiYjC4QnFHkOM=
github.com/secure-systems-lab/go-securesystemslib v0.8.0 h1:mr5An6X45Kb2nddcFlbmfHkLguCE9laoZCUzEEpIZXA=
Expand Down
14 changes: 14 additions & 0 deletions internal/namespaces/lb/v1/lb_cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -1979,6 +1979,13 @@ func lbRouteCreate() *core.Command {
Deprecated: false,
Positional: false,
},
{
Name: "match.match-subdomains",
Short: `If true, all subdomains will match`,
Required: false,
Deprecated: false,
Positional: false,
},
core.ZoneArgSpec(scw.ZoneFrPar1, scw.ZoneFrPar2, scw.ZoneNlAms1, scw.ZoneNlAms2, scw.ZoneNlAms3, scw.ZonePlWaw1, scw.ZonePlWaw2, scw.ZonePlWaw3),
},
Run: func(ctx context.Context, args interface{}) (i interface{}, e error) {
Expand Down Expand Up @@ -2060,6 +2067,13 @@ func lbRouteUpdate() *core.Command {
Deprecated: false,
Positional: false,
},
{
Name: "match.match-subdomains",
Short: `If true, all subdomains will match`,
Required: false,
Deprecated: false,
Positional: false,
},
core.ZoneArgSpec(scw.ZoneFrPar1, scw.ZoneFrPar2, scw.ZoneNlAms1, scw.ZoneNlAms2, scw.ZoneNlAms3, scw.ZonePlWaw1, scw.ZonePlWaw2, scw.ZonePlWaw3),
},
Run: func(ctx context.Context, args interface{}) (i interface{}, e error) {
Expand Down
Loading