Skip to content

Commit

Permalink
feat(commands): transform tag optional on create bucket
Browse files Browse the repository at this point in the history
  • Loading branch information
joe-prosser committed Nov 1, 2023
1 parent 45cb013 commit d96ace5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
## Unreleased
- Fix url used for fetching streams
- Return `is_end_sequence` on stream fetch
- Make `transform_tag` optional on `create bucket`

## v0.20.0

Expand Down
12 changes: 11 additions & 1 deletion cli/src/commands/create/bucket.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use crate::printer::Printer;
use anyhow::{Context, Result};
use log::info;
use once_cell::sync::Lazy;
use reinfer_client::{BucketFullName, BucketType, Client, NewBucket, TransformTag};
use structopt::StructOpt;

Expand All @@ -21,9 +22,12 @@ pub struct CreateBucketArgs {
#[structopt(long = "transform-tag")]
/// Set the transform tag of the new bucket. You will be given this value
/// by a Re:infer engineer.
transform_tag: TransformTag,
transform_tag: Option<TransformTag>,
}

static DEFAULT_TRANSFORM_TAG: Lazy<TransformTag> =
Lazy::new(|| TransformTag("generic.0.CONVKER5".to_string()));

pub fn create(client: &Client, args: &CreateBucketArgs, printer: &Printer) -> Result<()> {
let CreateBucketArgs {
name,
Expand All @@ -32,6 +36,12 @@ pub fn create(client: &Client, args: &CreateBucketArgs, printer: &Printer) -> Re
transform_tag,
} = args;

let transform_tag = &if let Some(transform_tag) = transform_tag {
transform_tag.clone()
} else {
DEFAULT_TRANSFORM_TAG.clone()
};

let bucket = client
.create_bucket(
name,
Expand Down

0 comments on commit d96ace5

Please sign in to comment.