Skip to content

Commit

Permalink
fix: Return string value, not string encoded json value
Browse files Browse the repository at this point in the history
Signed-off-by: Bryant Biggs <[email protected]>
  • Loading branch information
bryantbiggs committed Nov 11, 2024
1 parent 563c4f1 commit cbdda8d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion kube-client/src/client/auth/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit cbdda8d

Please sign in to comment.