Skip to content

Commit 8e2e321

Browse files
committed
fix: return error when 'kind load docker-image' fails
Signed-off-by: Tyler Gillson <tyler.gillson@gmail.com>
1 parent f91dc66 commit 8e2e321

File tree

1 file changed

+13
-17
lines changed

1 file changed

+13
-17
lines changed

pkg/devspace/build/builder/docker/docker.go

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,37 +4,33 @@ import (
44
"context"
55
"encoding/base64"
66
"encoding/json"
7-
devspacecontext "github.com/loft-sh/devspace/pkg/devspace/context"
8-
"github.com/loft-sh/devspace/pkg/devspace/kubectl"
9-
command2 "github.com/loft-sh/devspace/pkg/util/command"
10-
"github.com/sirupsen/logrus"
117
"io"
128
"os"
139
"path/filepath"
1410
"strings"
1511

12+
"github.com/docker/cli/cli/command/image/build"
1613
"github.com/docker/cli/cli/streams"
17-
"github.com/loft-sh/devspace/pkg/devspace/build/builder/restart"
18-
19-
"github.com/loft-sh/devspace/pkg/devspace/build/builder/helper"
20-
"github.com/loft-sh/devspace/pkg/devspace/config/versions/latest"
21-
dockerclient "github.com/loft-sh/devspace/pkg/devspace/docker"
22-
"github.com/loft-sh/devspace/pkg/devspace/pullsecrets"
23-
logpkg "github.com/loft-sh/devspace/pkg/util/log"
24-
2514
"github.com/docker/distribution/reference"
26-
27-
"github.com/docker/cli/cli/command/image/build"
2815
"github.com/docker/docker/api/types"
2916
"github.com/docker/docker/pkg/archive"
3017
"github.com/docker/docker/pkg/idtools"
31-
18+
"github.com/docker/docker/pkg/jsonmessage"
3219
"github.com/docker/docker/pkg/progress"
3320
"github.com/docker/docker/pkg/streamformatter"
3421
dockerterm "github.com/moby/term"
3522
"github.com/pkg/errors"
23+
"github.com/sirupsen/logrus"
3624

37-
"github.com/docker/docker/pkg/jsonmessage"
25+
"github.com/loft-sh/devspace/pkg/devspace/build/builder/helper"
26+
"github.com/loft-sh/devspace/pkg/devspace/build/builder/restart"
27+
"github.com/loft-sh/devspace/pkg/devspace/config/versions/latest"
28+
devspacecontext "github.com/loft-sh/devspace/pkg/devspace/context"
29+
dockerclient "github.com/loft-sh/devspace/pkg/devspace/docker"
30+
"github.com/loft-sh/devspace/pkg/devspace/kubectl"
31+
"github.com/loft-sh/devspace/pkg/devspace/pullsecrets"
32+
command2 "github.com/loft-sh/devspace/pkg/util/command"
33+
logpkg "github.com/loft-sh/devspace/pkg/util/log"
3834
)
3935

4036
// EngineName is the name of the building engine
@@ -199,7 +195,7 @@ func (b *Builder) BuildImage(ctx devspacecontext.Context, contextPath, dockerfil
199195
defer writeCloser.Close()
200196
err = command2.CommandWithEnv(ctx.Context(), ctx.WorkingDir(), writeCloser, writeCloser, nil, nil, command[0], completeArgs...)
201197
if err != nil {
202-
ctx.Log().Info(errors.Errorf("error during image load to kind cluster: %v", err))
198+
return errors.Errorf("error during image load to kind cluster: %v", err)
203199
}
204200
ctx.Log().Info("Image loaded to kind cluster")
205201
}

0 commit comments

Comments
 (0)