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

Allow updating Object Store metadata headers and metadata #1362

Merged
merged 3 commits into from
Jan 8, 2025
Merged
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
7 changes: 7 additions & 0 deletions async-nats/src/jetstream/object_store/mod.rs
Original file line number Diff line number Diff line change
@@ -550,6 +550,7 @@ impl ObjectStore {
/// object_store::UpdateMetadata {
/// name: "new_name".to_string(),
/// description: Some("a new description".to_string()),
/// ..Default::default()
/// },
/// )
/// .await?;
@@ -1128,6 +1129,11 @@ pub struct UpdateMetadata {
pub name: String,
/// A short human readable description of the object.
pub description: Option<String>,
/// Metadata for given object.
#[serde(default)]
pub metadata: HashMap<String, String>,
/// Headers for given object.
pub headers: Option<HeaderMap>,
}

/// Meta information about an object.
@@ -1140,6 +1146,7 @@ pub struct ObjectMetadata {
/// Max chunk size. Default is 128k.
pub chunk_size: Option<usize>,
/// Metadata for given object.
#[serde(default)]
pub metadata: HashMap<String, String>,
/// Headers for given object.
pub headers: Option<HeaderMap>,
3 changes: 3 additions & 0 deletions async-nats/tests/kv_tests.rs
Original file line number Diff line number Diff line change
@@ -984,6 +984,9 @@ mod kv {
assert_eq!("bar.$KV.test.key", message.subject.as_str());
}

// This test if flaky due to its assumptions.
// It is set to ignored until those are resolved.
#[ignore]
#[tokio::test]
async fn cross_account_mirrors() {
let hub_server = nats_server::run_server("tests/configs/jetstream_hub.conf");
1 change: 1 addition & 0 deletions async-nats/tests/object_store.rs
Original file line number Diff line number Diff line change
@@ -478,6 +478,7 @@ mod object_store {
let given_metadata = UpdateMetadata {
name: "new_object".to_owned(),
description: Some("description".to_string()),
..Default::default()
};

bucket