Remove silent error when client-key/client-certificate is malformed#1966
Merged
Conversation
Signed-off-by: goenning <me@goenning.net>
Signed-off-by: goenning <me@goenning.net>
Signed-off-by: goenning <me@goenning.net>
Signed-off-by: goenning <me@goenning.net>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1966 +/- ##
=======================================
- Coverage 76.5% 76.5% -0.0%
=======================================
Files 89 89
Lines 8585 8596 +11
=======================================
+ Hits 6565 6569 +4
- Misses 2020 2027 +7
🚀 New features to boost your workflow:
|
clux
approved these changes
May 1, 2026
Member
clux
left a comment
There was a problem hiding this comment.
Thanks for this. Sorry, just getting around to things again.
One minor request if you have time for it, otherwise this looks sensible to me.
Comment on lines
+636
to
+649
| pub(crate) fn identity_pem(&self) -> Result<Option<Vec<u8>>, KubeconfigError> { | ||
| let client_cert = self.load_client_certificate()?; | ||
| let client_key = self.load_client_key()?; | ||
|
|
||
| match (client_cert, client_key) { | ||
| (None, None) => Ok(None), | ||
|
|
||
| (Some(_), None) => Err(KubeconfigError::LoadClientKey( | ||
| LoadDataError::NoBase64DataOrFile, | ||
| )), | ||
|
|
||
| (None, Some(_)) => Err(KubeconfigError::LoadClientCertificate( | ||
| LoadDataError::NoBase64DataOrFile, | ||
| )), |
Member
There was a problem hiding this comment.
a test for an error case here might be useful, since this is a bit difficult to fully trust in your head
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
malformed client-key/client-certificate are currently being ignored
Solution
bubble up the error instead of silently ignoring it