Skip to content

Commit 3767066

Browse files
authored
fix(functions): set content length as required (#3333)
1 parent 9883cc5 commit 3767066

File tree

5 files changed

+9
-8
lines changed

5 files changed

+9
-8
lines changed

cmd/scw/testdata/test-all-usage-function-function-get-upload-url-usage.golden

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ USAGE:
66
scw function function get-upload-url <function-id ...> [arg=value ...]
77

88
ARGS:
9-
function-id UUID of the function to get the upload URL for
10-
[content-length]
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+
function-id UUID of the function to get the upload URL for
10+
content-length Size of the archive to upload in bytes
11+
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | nl-ams | pl-waw)
1212

1313
FLAGS:
1414
-h, --help help for get-upload-url

docs/commands/function.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,7 @@ scw function function get-upload-url <function-id ...> [arg=value ...]
426426
| Name | | Description |
427427
|------|---|-------------|
428428
| function-id | Required | UUID of the function to get the upload URL for |
429-
| content-length | | |
429+
| content-length | Required | Size of the archive to upload in bytes |
430430
| 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 |
431431

432432

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.20.0.20230807145308-73ed2d61d96c
27+
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.20.0.20230809092428-2d15631f7d8c
2828
github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966
2929
github.com/spf13/cobra v1.7.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
@@ -491,8 +491,8 @@ github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncj
491491
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
492492
github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06 h1:OkMGxebDjyw0ULyrTYWeN0UNCCkmCWfjPnIA2W6oviI=
493493
github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06/go.mod h1:+ePHsJ1keEjQtpvf9HHw0f4ZeJ0TLRsxhunSI2hYJSs=
494-
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.20.0.20230807145308-73ed2d61d96c h1:5o0JFJMilcxdflia5nxn3ZGiUedJ0crjEOzVZrvlrSs=
495-
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.20.0.20230807145308-73ed2d61d96c/go.mod h1:fCa7OJZ/9DRTnOKmxvT6pn+LPWUptQAmHF/SBJUGEcg=
494+
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.20.0.20230809092428-2d15631f7d8c h1:qaE3ns5ubIZksLRTpdlVNh/Lj0jtUQqQ4ZCqSCazLmM=
495+
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.20.0.20230809092428-2d15631f7d8c/go.mod h1:fCa7OJZ/9DRTnOKmxvT6pn+LPWUptQAmHF/SBJUGEcg=
496496
github.com/sclevine/spec v1.4.0 h1:z/Q9idDcay5m5irkZ28M7PtQM4aOISzOpj4bUPkDee8=
497497
github.com/secure-systems-lab/go-securesystemslib v0.4.0 h1:b23VGrQhTA8cN2CbBw7/FulN9fTtqYUdS5+Oxzt+DUE=
498498
github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo=

internal/namespaces/function/v1beta1/function_cli.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -859,7 +859,8 @@ func functionFunctionGetUploadURL() *core.Command {
859859
},
860860
{
861861
Name: "content-length",
862-
Required: false,
862+
Short: `Size of the archive to upload in bytes`,
863+
Required: true,
863864
Deprecated: false,
864865
Positional: false,
865866
},

0 commit comments

Comments
 (0)