Skip to content

Commit 1807b19

Browse files
committed
imgutil: get default envbuilder binary path from envbuilder options
1 parent 569eddc commit 1807b19

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

internal/imgutil/imgutil.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ import (
77
"io"
88
"os"
99
"path/filepath"
10+
"strings"
1011

12+
eboptions "github.com/coder/envbuilder/options"
1113
"github.com/google/go-containerregistry/pkg/authn"
1214
"github.com/google/go-containerregistry/pkg/name"
1315
v1 "github.com/google/go-containerregistry/pkg/v1"
@@ -33,7 +35,9 @@ func GetRemoteImage(imgRef string) (v1.Image, error) {
3335
// ExtractEnvbuilderFromImage reads the image located at imgRef and extracts
3436
// MagicBinaryLocation to destPath.
3537
func ExtractEnvbuilderFromImage(ctx context.Context, imgRef, destPath string) error {
36-
needle := ".envbuilder/bin/envbuilder"
38+
var o eboptions.Options
39+
o.SetDefaults()
40+
needle := strings.TrimPrefix(o.BinaryPath, "/")
3741
img, err := GetRemoteImage(imgRef)
3842
if err != nil {
3943
return fmt.Errorf("check remote image: %w", err)

0 commit comments

Comments
 (0)