checkVersioningWithGoogleEndpoint checks if the versioning flags are used with the Google Endpoint. Because the s3 versioning operations are not compatible with GCS's versioning API.
(ctx *cli.Context)
| 38 | // the Google Endpoint. Because the s3 versioning operations are not compatible with |
| 39 | // GCS's versioning API. |
| 40 | func checkVersioningWithGoogleEndpoint(ctx *cli.Context) error { |
| 41 | endpoint := ctx.String("endpoint-url") |
| 42 | if endpoint == "" { |
| 43 | return nil |
| 44 | } |
| 45 | |
| 46 | u, err := urlpkg.Parse(endpoint) |
| 47 | if err != nil { |
| 48 | return err |
| 49 | } |
| 50 | |
| 51 | if storage.IsGoogleEndpoint(*u) && (ctx.Bool(allVersionsFlagName) || ctx.String(versionIDFlagName) != "") { |
| 52 | return fmt.Errorf(versioningNotSupportedWarning, endpoint) |
| 53 | } |
| 54 | |
| 55 | return nil |
| 56 | } |
| 57 | |
| 58 | // checkNumberOfArguments checks if the number of the arguments is valid. |
| 59 | // if the max is negative then there is no upper limit of arguments. |
no test coverage detected