-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Current storage backend creation in the CLI leaks memory.
Maybe we can add small helper ? But this is separate issue, anyway.
fn create_storage_backend(storage_type: &str, storage_url: &str) -> Result<Box<dyn StorageBackend>> {
match storage_type {
"local-fs" => Ok(Box::new(FilesystemStorage::new(storage_url)?)),
"database" => Ok(Box::new(DatabaseStorage::new(storage_url.to_string())?)),
"rekor" => Ok(Box::new(RekorStorage::new_with_url(storage_url.to_string())?)),
_ => Err(Error::Validation(format!("Unsupported storage type: {}", storage_type))),
}
}let storage = if print { None } else { Some(create_storage_backend(storage_type.as_str(), storage_url.as_str())?) };or something similar
Originally posted by @sandlbn in #55 (comment)
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working