Skip to content

Commit

Permalink
core: add missing reason to Display on Error::Validation in Request (#…
Browse files Browse the repository at this point in the history
…798)

Signed-off-by: clux <sszynrae@gmail.com>
  • Loading branch information
clux authored Jan 28, 2022
1 parent 93fcff3 commit 3381e69
Showing 1 changed file with 9 additions and 1 deletion.
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"));
}
}

0 comments on commit 3381e69

Please sign in to comment.