-
Notifications
You must be signed in to change notification settings - Fork 40
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
[sled-agent][sim] Use a shared support bundle implementation #7264
base: support-bundles-crdb
Are you sure you want to change the base?
[sled-agent][sim] Use a shared support bundle implementation #7264
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @smklein, this wrapper trait seems reasonable to me. Two related questions around how we're walking the path of nested datasets.
// Final component of path -- remove it if it exists. | ||
if !path_component.contains('/') { | ||
if nested_dataset.children.remove(path_component).is_none() { | ||
return Err(HttpError::for_not_found( | ||
None, | ||
"Nested Dataset not found".to_string(), | ||
)); | ||
}; | ||
return Ok(()); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As above, no component will contain /
, so we'll always exit early and fail to iterate past the first component.
// Final component of path -- insert it here if it doesn't exist | ||
// already. | ||
if !path_component.contains('/') { | ||
let entry = | ||
nested_dataset.children.entry(path_component.to_string()); | ||
entry | ||
.and_modify(|storage| { | ||
storage.config = config.clone(); | ||
}) | ||
.or_insert_with(|| { | ||
NestedDatasetStorage::new( | ||
&zpool_root, | ||
config.name.root, | ||
nested_path, | ||
config.inner, | ||
) | ||
}); | ||
return Ok(()); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This condition will always evaluate to true since we're splitting path_component
on /
, so we'll never walk the full path.
PR 3 / ???
This PR aims to re-use the support bundle management logic in sled-agent/src/support_bundle/storage.rs for both the real and simulated sled agent.
It accomplishes this goal with the following:
LocalStorage
, that abstracts access to storage. The "real" sled agent accesses real storage, the simulated sled agent can access the simulated storage APIs..await
calls throughout Omicron.As an end result of this PR, tests in subsequent PRs (e.g. #7063) can rely on the simulated sled agent to respond realistically to support bundle requests, rather than using a stub implementation.