Disable certs list in state (#113)

This commit is contained in:
Itxaka 2024-05-14 08:24:03 +00:00 committed by GitHub
parent d16d672cf0
commit c643cb5e73
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -11,7 +11,6 @@ import (
"github.com/itchyny/gojq" "github.com/itchyny/gojq"
"github.com/jaypipes/ghw" "github.com/jaypipes/ghw"
"github.com/jaypipes/ghw/pkg/block" "github.com/jaypipes/ghw/pkg/block"
"github.com/kairos-io/kairos-sdk/signatures"
"github.com/kairos-io/kairos-sdk/types" "github.com/kairos-io/kairos-sdk/types"
"github.com/kairos-io/kairos-sdk/utils" "github.com/kairos-io/kairos-sdk/utils"
"github.com/rs/zerolog" "github.com/rs/zerolog"
@ -326,7 +325,9 @@ func detectKairos(r *Runtime) {
k.Version = v k.Version = v
} }
k.Init = utils.GetInit() k.Init = utils.GetInit()
k.EfiCerts = getEfiCertsCommonNames() // go-uefi calls os.exit directly if it fails which breaks state. we cannot tolerate that as for us state is
// mainly optional data, not a failure if we cant find it
//k.EfiCerts = getEfiCertsCommonNames()
k.SecureBoot = efi.GetSecureBoot() k.SecureBoot = efi.GetSecureBoot()
r.Kairos = *k r.Kairos = *k
@ -359,8 +360,10 @@ func detectEncryptedPartitions(runtime *Runtime) {
} }
// getEfiCertsCommonNames returns a simple list of the Common names of the certs // getEfiCertsCommonNames returns a simple list of the Common names of the certs
/*
func getEfiCertsCommonNames() types.EfiCerts { func getEfiCertsCommonNames() types.EfiCerts {
var data types.EfiCerts var data types.EfiCerts
certs, _ := signatures.GetAllCerts() // Ignore errors here, we dont care about them, we only want the presentation of the names certs, _ := signatures.GetAllCerts() // Ignore errors here, we dont care about them, we only want the presentation of the names
for _, c := range certs.PK { for _, c := range certs.PK {
data.PK = append(data.PK, c.Issuer.CommonName) data.PK = append(data.PK, c.Issuer.CommonName)
@ -373,6 +376,7 @@ func getEfiCertsCommonNames() types.EfiCerts {
} }
return data return data
} }
*/
func NewRuntimeWithLogger(logger zerolog.Logger) (Runtime, error) { func NewRuntimeWithLogger(logger zerolog.Logger) (Runtime, error) {
logger.Info().Msg("creating a runtime") logger.Info().Msg("creating a runtime")