treewide: cleanup error string formatting
Change-Id: I9012ba58dded916984468219b214200144a439b9
Reviewed-on: https://review.monogon.dev/c/monogon/+/3023
Reviewed-by: Serge Bazanski <serge@monogon.tech>
Vouch-Run-CI: Tim Windelschmidt <tim@monogon.tech>
Tested-by: Jenkins CI
diff --git a/cloud/agent/agent.go b/cloud/agent/agent.go
index 2805f42..8efafd0 100644
--- a/cloud/agent/agent.go
+++ b/cloud/agent/agent.go
@@ -58,7 +58,7 @@
}
agentInitRaw, err := os.ReadFile("/init.pb")
if err != nil {
- return fmt.Errorf("Unable to read spec file from takeover: %w", err)
+ return fmt.Errorf("unable to read spec file from takeover: %w", err)
}
var agentInit apb.AgentInit
diff --git a/cloud/agent/install.go b/cloud/agent/install.go
index f209ce3..5b0c209 100644
--- a/cloud/agent/install.go
+++ b/cloud/agent/install.go
@@ -52,6 +52,7 @@
func installMetropolis(req *bpb.MetropolisInstallationRequest, netConfig *npb.Net, l logtree.LeveledLogger, isEFIBoot bool) error {
if !isEFIBoot {
+ //nolint:ST1005
return errors.New("Monogon OS can only be installed on EFI-booted machines, this one is not")
}
diff --git a/cloud/shepherd/manager/initializer.go b/cloud/shepherd/manager/initializer.go
index 2c04c43..a380a8f 100644
--- a/cloud/shepherd/manager/initializer.go
+++ b/cloud/shepherd/manager/initializer.go
@@ -263,10 +263,10 @@
return nil, fmt.Errorf("agent returned unknown result of type %T", arsp.Result)
}
if !proto.Equal(&imsg, successResp.InitMessage) {
- return nil, fmt.Errorf("agent did not send back the init message.")
+ return nil, fmt.Errorf("agent did not send back the init message")
}
if len(successResp.Key) != ed25519.PublicKeySize {
- return nil, fmt.Errorf("agent key length mismatch.")
+ return nil, fmt.Errorf("agent key length mismatch")
}
klog.Infof("Started the agent (machine ID: %s, key: %s).", mid, hex.EncodeToString(successResp.Key))
return successResp.Key, nil