Skip to content

Commit

Permalink
Fix input validation on cb create [--fork | --replica]
Browse files Browse the repository at this point in the history
It was found that input validation was failing when creating a fork or
replica using the `--network` option. Specifically, the following error
was being returned:

``` error: Missing required arguments: platform, plan, region, storage
```

This is because when specifying a network none of these items are
required. Most importantly the platform and region are not allowed. This
was a minor oversight when allowing cross-region replicas was first
implemented.  Here we simply fix that issue and if `--network` is given
then we do not require the platform or region as well.
  • Loading branch information
abrightwell committed Aug 10, 2023
1 parent 2b3aaea commit dbf687a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
parameters. Supports `get`, `list-supported`, `reset` and `set`.

### Fixed
- `cb create --fork` and `cb create --replica` input validation when using
`--network`.
- `cb network` command completion suggestions.


Expand Down
1 change: 0 additions & 1 deletion src/cb/cluster_create.cr
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ class CB::ClusterCreate < CB::APIAction
target_time: @at,
))
elsif replica
puts params.inspect
@client.create_replica CB::Client::ReplicaCreateParams.new(**params.merge(
cluster_id: @replica.to_s,
))
Expand Down

0 comments on commit dbf687a

Please sign in to comment.