From ae55ed00ff1c6adef4a8b59086ed0eb4c6c32a33 Mon Sep 17 00:00:00 2001 From: clux Date: Fri, 28 Jan 2022 10:10:16 +0000 Subject: [PATCH] core: add missing reason to Display on Error::Validation in Request Signed-off-by: clux --- kube-core/src/request.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/kube-core/src/request.rs b/kube-core/src/request.rs index 532f3b6af..892b15cca 100644 --- a/kube-core/src/request.rs +++ b/kube-core/src/request.rs @@ -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), } @@ -535,4 +535,12 @@ mod test { //fn all_resources_not_namespaceable() { // let _r = Request::::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")); + } }