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

[Merged by Bors] - Do not allow --initial when we are not using aggregate smartmodule #2476

Closed
wants to merge 2 commits into from
Closed
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Release Notes

## Platform Version 0.9.32 - UNRELEASED
* Restrict usage of `--initial`, `--extra-params` and `--join-topic` in `fluvio consume`. Those options only should be accepted when using specific smartmodules. ([#2476](https://github.com/infinyon/fluvio/pull/2476))

## Platform Version 0.9.31 - 2022-07-13
* Move stream publishers to connection-level context ([#2452](https://github.com/infinyon/fluvio/pull/2452))
Expand Down
23 changes: 17 additions & 6 deletions crates/fluvio-cli/src/consume/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,29 +158,40 @@ pub struct ConsumeOpt {
pub array_map: Option<String>,

/// Path to a SmartModule join wasm filee
#[clap(long, group("smartmodule_group"))]
#[clap(long, group("smartmodule_group"), group("join_group"))]
pub join: Option<String>,

/// Path to a WASM file for aggregation
#[clap(long, group("smartmodule_group"))]
#[clap(long, group("smartmodule_group"), group("aggregate_group"))]
pub aggregate: Option<String>,

/// Path or name to WASM module. This support any of the other
/// smartmodule types: filter, map, array_map, aggregate, join and filter_map
#[clap(long, group("smartmodule_group"))]
#[clap(
long,
group("smartmodule_group"),
group("aggregate_group"),
group("join_group")
)]
pub smartmodule: Option<String>,

#[clap(long)]
#[clap(long, requires = "join_group")]
pub join_topic: Option<String>,

/// (Optional) Path to a file to use as an initial accumulator value with --aggregate
#[clap(long)]
#[clap(long, requires = "aggregate_group")]
pub initial: Option<String>,

/// (Optional) Extra input parameters passed to the smartmodule module.
/// They should be passed using key=value format
/// Eg. fluvio consume topic-name --filter filter.wasm -e foo=bar -e key=value -e one=1
#[clap(short = 'e', long= "extra-params", parse(try_from_str = parse_key_val), number_of_values = 1)]
#[clap(
short = 'e',
requires = "smartmodule_group",
long= "extra-params",
parse(try_from_str = parse_key_val),
number_of_values = 1
)]
pub extra_params: Option<Vec<(String, String)>>,

/// Isolation level that consumer must respect.
Expand Down