-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Print the EFI certs in the state command #98
Conversation
Signed-off-by: Itxaka <[email protected]>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #98 +/- ##
=======================================
Coverage 52.89% 52.89%
=======================================
Files 16 16
Lines 1104 1104
=======================================
Hits 584 584
Misses 423 423
Partials 97 97 ☔ View full report in Codecov by Sentry. |
Signed-off-by: Itxaka <[email protected]>
Signed-off-by: Itxaka <[email protected]>
signatures/signatures.go
Outdated
// GetEfiCertsCommonNames returns a simple list of the Common names of the certs | ||
func GetEfiCertsCommonNames() types.EfiCerts { | ||
var data types.EfiCerts | ||
certs, _ := GetAllCerts() // Ignore errors here, we dont care about them |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is still in the sdk. We should let the caller decide whether it cares about the errors or not. Otherwise, the caller has no way to get the error (e.g. to debug) without using replace
in go.mod.
Since this is an exported function, feel free to ignore the error in the detectKairos
function below (if the caller of that function wants to debug, it can call GetEfiCertsCommonNames()
directly.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I dont know about that. This returns the certs if it can get them, otherwise its an empty eficerts. There is no promise here of returning errors or not, debugging and such, this is mostly an shortcut to not have to do the same thing in the state when getting the names and such, so its a commodity that promises nothing else in the signature of the call.
For getting the actual errors, and the full certificates (not just a list of the common names) there is another function that actually returns an error.
Maybe this should not be public, or maybe I should just move all the mangling into the state instead....
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated, now its a commodity method in state just to clean up the actual stuff coming from the signatures
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
Signed-off-by: Itxaka <[email protected]>
Signed-off-by: Itxaka <[email protected]>
Part of kairos-io/kairos#2484