diff options
Diffstat (limited to 'pkg/api/handlers/utils/containers.go')
-rw-r--r-- | pkg/api/handlers/utils/containers.go | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/pkg/api/handlers/utils/containers.go b/pkg/api/handlers/utils/containers.go index 6c708f74e..fb1f8b7c1 100644 --- a/pkg/api/handlers/utils/containers.go +++ b/pkg/api/handlers/utils/containers.go @@ -75,18 +75,19 @@ func WaitContainerDocker(w http.ResponseWriter, r *http.Request) { } exitCode, err := waitDockerCondition(ctx, name, interval, condition) - msg := "" + var errStruct *struct{ Message string } if err != nil { logrus.Errorf("error while waiting on condition: %q", err) - msg = err.Error() + errStruct = &struct { + Message string + }{ + Message: err.Error(), + } } + responseData := handlers.ContainerWaitOKBody{ StatusCode: int(exitCode), - Error: struct { - Message string - }{ - Message: msg, - }, + Error: errStruct, } enc := json.NewEncoder(w) enc.SetEscapeHTML(true) |