Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions envbuilder.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ import (
"github.com/mattn/go-isatty"
"github.com/sirupsen/logrus"
"github.com/tailscale/hujson"
"golang.org/x/xerrors"
)

// ErrNoFallbackImage is returned when no fallback image has been specified.
Expand Down Expand Up @@ -268,7 +267,7 @@ func run(ctx context.Context, opts options.Options, execArgs *execArgsInfo) erro
defer file.Close()
if opts.FallbackImage == "" {
if fallbackErr != nil {
return nil, xerrors.Errorf("%s: %w", fallbackErr.Error(), ErrNoFallbackImage)
return nil, fmt.Errorf("%s: %w", fallbackErr.Error(), ErrNoFallbackImage)
}
// We can't use errors.Join here because our tests
// don't support parsing a multiline error.
Expand Down Expand Up @@ -582,7 +581,7 @@ func run(ctx context.Context, opts options.Options, execArgs *execArgsInfo) erro
endStage := startStage("🏗️ Building image...")
image, err := executor.DoBuild(kOpts)
if err != nil {
return nil, xerrors.Errorf("do build: %w", err)
return nil, fmt.Errorf("do build: %w", err)
}
endStage("🏗️ Built image!")
if opts.PushImage {
Expand All @@ -602,7 +601,7 @@ func run(ctx context.Context, opts options.Options, execArgs *execArgsInfo) erro
} else if !opts.ExitOnPushFailure {
endStage("⚠️️ Failed to push image!")
} else {
return nil, xerrors.Errorf("do push: %w", err)
return nil, fmt.Errorf("do push: %w", err)
}
}

Expand Down Expand Up @@ -1253,7 +1252,7 @@ func RunCacheProbe(ctx context.Context, opts options.Options) (v1.Image, error)
// will need to specify the path to the desired envbuilder binary.
opts.Logger(log.LevelDebug, "copying envbuilder binary at %q to build context %q", opts.BinaryPath, envbuilderBinDest)
if err := copyFile(opts.Filesystem, opts.BinaryPath, envbuilderBinDest, 0o755); err != nil {
return nil, xerrors.Errorf("copy envbuilder binary to build context: %w", err)
return nil, fmt.Errorf("copy envbuilder binary to build context: %w", err)
}

// Also write the magic file that signifies the image has been built.
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ require (
golang.org/x/crypto v0.56.0
golang.org/x/mod v0.40.0
golang.org/x/sync v0.22.0
golang.org/x/xerrors v0.0.0-20240903120638-7835f813f4da
)

require (
Expand Down Expand Up @@ -384,6 +383,7 @@ require (
golang.org/x/text v0.41.0 // indirect
golang.org/x/time v0.15.0 // indirect
golang.org/x/tools v0.49.0 // indirect
golang.org/x/xerrors v0.0.0-20240903120638-7835f813f4da // indirect
golang.zx2c4.com/wintun v0.0.0-20230126152724-0fa3db229ce2 // indirect
golang.zx2c4.com/wireguard/windows v0.5.3 // indirect
google.golang.org/appengine v1.6.8 // indirect
Expand Down