Skip to content

Commit

Permalink
Improve error message
Browse files Browse the repository at this point in the history
Signed-off-by: Itxaka <[email protected]>
  • Loading branch information
Itxaka committed May 20, 2024
1 parent 2307e72 commit a9b9656
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pkg/uki/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -296,5 +296,5 @@ func checkArtifactSignatureIsValid(fs v1.FS, artifact string, logger sdkTypes.Ka
}
}
// If we reach this point, we need to fail as we haven't matched anything, so default is to fail
return errors.New("not ok")
return fmt.Errorf("could not find a signature in EFIVars DB that matches the upgrade artifact")
}
4 changes: 3 additions & 1 deletion pkg/uki/upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,9 @@ func (i *UpgradeAction) Run() (err error) {
if err != nil {
// Remove efi file to not occupy space and leave stuff around
_ = removeArtifactSetWithRole(i.cfg.Fs, constants.UkiEfiDir, UnassignedArtifactRole)
i.cfg.Logger.Logger.Error().Err(err).Msg("Checking signature")
i.cfg.Logger.Logger.Error().Err(err).Msg("Checking signature before upgrading")
i.cfg.Logger.Logger.Warn().Msg("Upgrade artifact signature does not match, upgrading to this source would result in an unbootable active system.\n" +
"Check the upgrade source and confirm that its signed with a valid key, that key is in the machine DB and it has not been blacklisted.")
return err
}

Expand Down

0 comments on commit a9b9656

Please sign in to comment.