Skip to content

Commit

Permalink
exec: ensure certs always end with a new line (#1096)
Browse files Browse the repository at this point in the history
ensure certs always end with a new line

Signed-off-by: goenning <me@goenning.net>

Signed-off-by: goenning <me@goenning.net>
Co-authored-by: Eirik A <sszynrae@gmail.com>
  • Loading branch information
goenning and clux committed Dec 6, 2022
1 parent b60202c commit 6c87ffe
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions kube-client/src/client/config_ext.rs
Expand Up @@ -232,8 +232,12 @@ impl Config {
fn exec_identity_pem(&self) -> Option<Vec<u8>> {
match Auth::try_from(&self.auth_info) {
Ok(Auth::Certificate(client_certificate_data, client_key_data)) => {
const NEW_LINE: u8 = b'\n';

let mut buffer = client_key_data.expose_secret().as_bytes().to_vec();
buffer.push(NEW_LINE);
buffer.extend_from_slice(client_certificate_data.as_bytes());
buffer.push(NEW_LINE);
Some(buffer)
}
_ => None,
Expand Down

0 comments on commit 6c87ffe

Please sign in to comment.