From d9a5fe0e814bf98c6b56cd4a2ab0c0882406b7a3 Mon Sep 17 00:00:00 2001 From: Ben Moss Date: Mon, 25 Oct 2021 11:06:50 -0400 Subject: [PATCH] Use build config dir Signed-off-by: Ben Moss --- pkg/build/gobuild.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/build/gobuild.go b/pkg/build/gobuild.go index b1f9a5d730..ad97332d75 100644 --- a/pkg/build/gobuild.go +++ b/pkg/build/gobuild.go @@ -166,7 +166,7 @@ func (g *gobuild) IsSupportedReference(s string) error { if !ref.IsStrict() { return errors.New("importpath does not start with ko://") } - pkgs, err := packages.Load(&packages.Config{Mode: packages.NeedName}, ref.Path()) + pkgs, err := packages.Load(&packages.Config{Dir: g.dir, Mode: packages.NeedName}, ref.Path()) if err != nil { return fmt.Errorf("error loading package from %s: %w", ref.Path(), err) } @@ -361,7 +361,7 @@ func tarBinary(name, binary string, creationTime v1.Time, platform *v1.Platform) } func (g *gobuild) kodataPath(ref reference) (string, error) { - pkgs, err := packages.Load(&packages.Config{Mode: packages.NeedFiles}, ref.Path()) + pkgs, err := packages.Load(&packages.Config{Dir: g.dir, Mode: packages.NeedFiles}, ref.Path()) if err != nil { return "", fmt.Errorf("error loading package from %s: %w", ref.Path(), err) }