diff --git a/cmd/podman-testing/store_supported.go b/cmd/podman-testing/store_supported.go index 9cd2843880..0dd6ddde26 100644 --- a/cmd/podman-testing/store_supported.go +++ b/cmd/podman-testing/store_supported.go @@ -38,7 +38,7 @@ func init() { func storeBefore() error { defaultStoreOptions, err := storage.DefaultStoreOptions() if err != nil { - fmt.Fprintf(os.Stderr, "selecting storage options: %v", err) + fmt.Fprintf(os.Stderr, "selecting storage options: %v\n", err) return nil } globalStorageOptions = defaultStoreOptions diff --git a/cmd/podman/root.go b/cmd/podman/root.go index 700b80939e..13a4aa210d 100644 --- a/cmd/podman/root.go +++ b/cmd/podman/root.go @@ -441,16 +441,16 @@ func configHook() { if err != nil && !errors.Is(err, fs.ErrNotExist) { // Cases where the folder does not exist are allowed, BUT cases where some other Stat() error // is returned should fail - fmt.Fprintf(os.Stderr, "Supplied --config folder (%s) exists but is not accessible: %s", dockerConfig, err.Error()) + fmt.Fprintf(os.Stderr, "Supplied --config folder (%s) exists but is not accessible: %s\n", dockerConfig, err.Error()) os.Exit(1) } if err == nil && !statInfo.IsDir() { // Cases where it does exist but is a file should fail - fmt.Fprintf(os.Stderr, "Supplied --config file (%s) is not a directory", dockerConfig) + fmt.Fprintf(os.Stderr, "Supplied --config file (%s) is not a directory\n", dockerConfig) os.Exit(1) } if err := os.Setenv("DOCKER_CONFIG", dockerConfig); err != nil { - fmt.Fprintf(os.Stderr, "cannot set DOCKER_CONFIG=%s: %s", dockerConfig, err.Error()) + fmt.Fprintf(os.Stderr, "cannot set DOCKER_CONFIG=%s: %s\n", dockerConfig, err.Error()) os.Exit(1) } } diff --git a/cmd/podman/syslog_unsupported.go b/cmd/podman/syslog_unsupported.go index 602c480b68..46f678b316 100644 --- a/cmd/podman/syslog_unsupported.go +++ b/cmd/podman/syslog_unsupported.go @@ -15,6 +15,6 @@ func syslogHook() { return } - fmt.Fprintf(os.Stderr, "Logging to Syslog is not supported on %s", runtime.GOOS) + fmt.Fprintf(os.Stderr, "Logging to Syslog is not supported on %s\n", runtime.GOOS) os.Exit(1) } diff --git a/pkg/farm/farm.go b/pkg/farm/farm.go index 7dfb495a8b..eba724253f 100644 --- a/pkg/farm/farm.go +++ b/pkg/farm/farm.go @@ -351,7 +351,7 @@ func (f *Farm) Build(ctx context.Context, schedule Schedule, options entities.Bu buildResults.Range(func(_, v any) bool { result, ok := v.(buildResult) if !ok { - fmt.Fprintf(os.Stderr, "report %v not a build result?", v) + fmt.Fprintf(os.Stderr, "report %v not a build result?\n", v) return false } perArchBuilds[result.report] = result.builder diff --git a/test/e2e/run_test.go b/test/e2e/run_test.go index 2b40ce5abe..ba5293fd75 100644 --- a/test/e2e/run_test.go +++ b/test/e2e/run_test.go @@ -100,7 +100,8 @@ var _ = Describe("Podman run", func() { tempFileName := tempFile.Name() session := podmanTest.Podman([]string{"--config", tempFileName, "run", ALPINE, "ls"}) session.WaitWithDefaultTimeout() - Expect(session).Should(ExitWithError(1, fmt.Sprintf(`Supplied --config file (%s) is not a directory`, tempFileName))) + // Note: ErrorToString() uses strings.Fields() which normalizes whitespace, so we're not testing the trailing newline + Expect(session).Should(ExitWithError(1, fmt.Sprintf("Supplied --config file (%s) is not a directory", tempFileName))) }) It("podman run from manifest list", func() {