Skip to content

Commit cbdda8d

Browse files
committed
fix: Return string value, not string encoded json value
Signed-off-by: Bryant Biggs <[email protected]>
1 parent 563c4f1 commit cbdda8d

File tree

1 file changed

+6
-1
lines changed
  • kube-client/src/client/auth

1 file changed

+6
-1
lines changed

kube-client/src/client/auth/mod.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -516,7 +516,12 @@ fn extract_value(json: &serde_json::Value, context: &str, path: &str) -> Result<
516516
)));
517517
};
518518

519-
Ok(res.to_data().to_string())
519+
let jval = res.to_data();
520+
let val = jval.as_str().ok_or(Error::AuthExec(format!(
521+
"Target {context:?} value {path:?} is not a string"
522+
)))?;
523+
524+
Ok(val.to_string())
520525
}
521526

522527
/// ExecCredentials is used by exec-based plugins to communicate credentials to

0 commit comments

Comments
 (0)