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

core: add missing reason to Display on Error::Validation in Request #798

Merged
merged 1 commit into from
Jan 28, 2022
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
10 changes: 9 additions & 1 deletion kube-core/src/request.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ pub enum Error {
#[error("failed to serialize body: {0}")]
SerializeBody(#[source] serde_json::Error),
/// Failed to validate request.
#[error("failed to validate request")]
#[error("failed to validate request: {0}")]
Validation(String),
}

Expand Down Expand Up @@ -535,4 +535,12 @@ mod test {
//fn all_resources_not_namespaceable() {
// let _r = Request::<corev1::Node>::new(&(), Some("ns"));
//}

#[test]
fn watches_cannot_have_limits() {
let lp = ListParams::default().limit(5);
let url = corev1::Pod::url_path(&(), Some("ns"));
let err = Request::new(url).watch(&lp, "0").unwrap_err();
assert!(format!("{}", err).contains("limit cannot be used with a watch"));
}
}