From 55b5605a05436cd52c32ac0b5ef85ffadc517043 Mon Sep 17 00:00:00 2001 From: Bryant Biggs Date: Sun, 10 Nov 2024 19:49:35 -0600 Subject: [PATCH] fix: Return string value, not string encoded json value --- kube-client/src/client/auth/mod.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/kube-client/src/client/auth/mod.rs b/kube-client/src/client/auth/mod.rs index beb94b291..f051bba45 100644 --- a/kube-client/src/client/auth/mod.rs +++ b/kube-client/src/client/auth/mod.rs @@ -516,7 +516,12 @@ fn extract_value(json: &serde_json::Value, context: &str, path: &str) -> Result< ))); }; - Ok(res.to_data().to_string()) + let jval = res.to_data(); + let val = jval.as_str().ok_or(Error::AuthExec(format!( + "Target {context:?} value {path:?} is not a string" + )))?; + + Ok(val.to_string()) } /// ExecCredentials is used by exec-based plugins to communicate credentials to