From 1b83250a42cb1a08fc7460533d51d9c05b2f1d66 Mon Sep 17 00:00:00 2001 From: Tedi Mitiku Date: Tue, 29 Oct 2024 13:56:12 +0900 Subject: [PATCH] use cmd string for err --- .../lib/backend_impls/docker/docker_manager/docker_auth.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/container-engine-lib/lib/backend_impls/docker/docker_manager/docker_auth.go b/container-engine-lib/lib/backend_impls/docker/docker_manager/docker_auth.go index 2ca583dc74..9fdae1317a 100644 --- a/container-engine-lib/lib/backend_impls/docker/docker_manager/docker_auth.go +++ b/container-engine-lib/lib/backend_impls/docker/docker_manager/docker_auth.go @@ -59,14 +59,14 @@ func getRegistriesFromCredsStore(credHelper string) ([]string, error) { cmd.Stderr = &stderr if err := cmd.Run(); err != nil { - return nil, stacktrace.Propagate(err, "error executing credential helper %s: %s", credHelperCmd, stderr.String()) + return nil, stacktrace.Propagate(err, "error executing credential helper '%s': %s", cmd.String(), stderr.String()) } // Output will look like this: {"https://index.docker.io/v1/":"username"} var result map[string]string outStr := out.String() err := json.Unmarshal([]byte(outStr), &result) if err != nil { - return nil, stacktrace.Propagate(err, "error unmarshaling credential helper list output %s: %s", credHelperCmd, outStr) + return nil, stacktrace.Propagate(err, "error unmarshaling credential helper list output '%s': %s", cmd.String(), outStr) } registries := []string{} @@ -91,7 +91,7 @@ func getCredentialsFromStore(credHelper string, registryURL string) (*registry.A cmd.Stderr = &stderr if err := cmd.Run(); err != nil { - return nil, stacktrace.Propagate(err, "error executing credential helper %s: %s", credHelperCmd, stderr.String()) + return nil, stacktrace.Propagate(err, "error executing credential helper '%s' for '%s': %s", cmd.String(), registryURL, stderr.String()) } // Parse the output (it should return JSON containing "Username", "Secret" and "ServerURL")