Check role of efi conf with prefix (#71)

Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>
This commit is contained in:
Mauro Morales
2024-02-29 19:56:53 +01:00
committed by GitHub
parent e0ea9975a4
commit ab666f1b15

View File

@@ -154,12 +154,16 @@ func getUKIBootState(logger zerolog.Logger) Boot {
logger.Debug().Msg("Current entry: " + currentEntry) logger.Debug().Msg("Current entry: " + currentEntry)
if !strings.HasSuffix(currentEntry, ".conf") {
return Unknown
}
switch { switch {
case strings.HasSuffix(currentEntry, "active.conf"): case strings.HasPrefix(currentEntry, "active"):
return Active return Active
case strings.HasSuffix(currentEntry, "passive.conf"): case strings.HasPrefix(currentEntry, "passive"):
return Passive return Passive
case strings.HasSuffix(currentEntry, "recovery.conf"): case strings.HasPrefix(currentEntry, "recovery"):
return Recovery return Recovery
default: default:
return Unknown return Unknown