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 21, 2024
1 parent fe51ddc commit 2cf5015
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 @@ -1092,7 +1091,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 @@ -1459,7 +1459,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 2cf5015

Please sign in to comment.