Skip to content

Commit

Permalink
review feedback
Browse files Browse the repository at this point in the history
Signed-off-by: Dan Luhring <[email protected]>
  • Loading branch information
luhring committed May 22, 2024
1 parent 3746722 commit 464b8bb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
7 changes: 3 additions & 4 deletions pkg/build/gobuild.go
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ func getDelve(ctx context.Context, platform v1.Platform) (string, error) {

// find the delve binary in tmpInstallDir/bin/
delveBinary := ""
err = filepath.WalkDir(filepath.Join(tmpInstallDir, "bin"), func(path string, d fs.DirEntry, err error) error {
if err := filepath.WalkDir(filepath.Join(tmpInstallDir, "bin"), func(path string, d fs.DirEntry, err error) error {
if err != nil {
return err
}
Expand All @@ -323,8 +323,7 @@ func getDelve(ctx context.Context, platform v1.Platform) (string, error) {
}

return nil
})
if err != nil {
}); err != nil {
return "", fmt.Errorf("could not search for Delve binary: %w", err)
}

Expand Down Expand Up @@ -1100,7 +1099,7 @@ func (g *gobuild) buildOne(ctx context.Context, refStr string, base v1.Image, pl
}
defer os.RemoveAll(filepath.Dir(delveBinary))

delvePath = "/usr/bin/" + filepath.Base(delveBinary)
delvePath = path.Join("/ko-app", filepath.Base(delveBinary))

// add layer with delve binary
delveLayer, err := g.cache.get(ctx, delveBinary, func() (v1.Layer, error) {
Expand Down
2 changes: 1 addition & 1 deletion pkg/build/gobuild_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1489,7 +1489,7 @@ func TestDebugger(t *testing.T) {
}
gotEntrypoint := cfg.Config.Entrypoint
wantEntrypoint := []string{
"/usr/bin/dlv",
"/ko-app/dlv",
"exec",
"--listen=:40000",
"--headless",
Expand Down

0 comments on commit 464b8bb

Please sign in to comment.