diff --git a/examples/dynamic_jsonpath.rs b/examples/dynamic_jsonpath.rs index 04a5827b1..bc4b02d48 100644 --- a/examples/dynamic_jsonpath.rs +++ b/examples/dynamic_jsonpath.rs @@ -35,9 +35,7 @@ async fn main() -> anyhow::Result<()> { // Use the given JSONPATH to filter the ObjectList let list_json = serde_json::to_value(&list)?; for res in jsonpath.find_slice(&list_json) { - if let Some(path) = res.to_path() { - info!("\t\t: {path}"); - } + info!("\t\t {}", res.to_data()); } Ok(()) } diff --git a/kube-client/src/client/auth/mod.rs b/kube-client/src/client/auth/mod.rs index f112a459e..beb94b291 100644 --- a/kube-client/src/client/auth/mod.rs +++ b/kube-client/src/client/auth/mod.rs @@ -516,14 +516,7 @@ fn extract_value(json: &serde_json::Value, context: &str, path: &str) -> Result< ))); }; - if let Some(val) = res.clone().to_path() { - Ok(val.to_owned()) - } else { - Err(Error::AuthExec(format!( - "Target {:?} value {:?} is not a string: {:?}", - context, path, res - ))) - } + Ok(res.to_data().to_string()) } /// ExecCredentials is used by exec-based plugins to communicate credentials to