From 73101d2ff2c1348398c107b338cfac1e16cf0c81 Mon Sep 17 00:00:00 2001 From: "Brian C. Lane" Date: Thu, 16 Jan 2025 11:36:04 -0800 Subject: [PATCH] Fix non-constant log strings Newer versions of the go compiler (1.24 in this case) fail when running go test during a mock rebuild of the srpm created by 'make srpm' on Fedora 42. Even though we currently don't support go1.24, fix these so they don't become an issue when we do. --- cmd/osbuild-composer/main.go | 2 +- cmd/osbuild-worker-executor/handler_build.go | 2 +- internal/auth/jwt_auth_handler.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cmd/osbuild-composer/main.go b/cmd/osbuild-composer/main.go index eeb724c9e..77adfa55e 100644 --- a/cmd/osbuild-composer/main.go +++ b/cmd/osbuild-composer/main.go @@ -131,7 +131,7 @@ func main() { listeners, err := activation.ListenersWithNames() if err != nil { - logrus.Fatalf("Could not get listening sockets: " + err.Error()) + logrus.Fatalf("Could not get listening sockets: %v", err) } if l, exists := listeners["osbuild-composer.socket"]; exists { diff --git a/cmd/osbuild-worker-executor/handler_build.go b/cmd/osbuild-worker-executor/handler_build.go index eed9b740d..65d338e5f 100644 --- a/cmd/osbuild-worker-executor/handler_build.go +++ b/cmd/osbuild-worker-executor/handler_build.go @@ -94,7 +94,7 @@ func runOsbuild(logger *logrus.Logger, buildDir string, control *controlJSON, ou out, err := cmd.CombinedOutput() if err != nil { err = fmt.Errorf("cannot tar output directory: %w, output:\n%s", err, out) - logger.Errorf(err.Error()) + logger.Errorf("%v", err) _, _ = mw.Write([]byte(err.Error())) return "", err } diff --git a/internal/auth/jwt_auth_handler.go b/internal/auth/jwt_auth_handler.go index 528d3f64b..f572c3e79 100644 --- a/internal/auth/jwt_auth_handler.go +++ b/internal/auth/jwt_auth_handler.go @@ -26,7 +26,7 @@ func BuildJWTAuthHandler(keysURLs []string, caFile, aclFile string, exclude []st return } - logger.Info(context.Background(), aclFile) + logger.Info(context.Background(), "aclFile = %s", aclFile) builder := authentication.NewHandler(). Logger(logger)