Skip to content

Commit

Permalink
Fix regression in adding /ko-app to PATH (#448)
Browse files Browse the repository at this point in the history
  • Loading branch information
imjasonh authored Sep 27, 2021
1 parent 5a8663b commit 2adcadd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions pkg/build/gobuild.go
Original file line number Diff line number Diff line change
Expand Up @@ -742,7 +742,8 @@ func (g *gobuild) buildOne(ctx context.Context, refStr string, base v1.Image, pl
},
})

appPath := path.Join("/ko-app", appFilename(ref.Path()))
appDir := "/ko-app"
appPath := path.Join(appDir, appFilename(ref.Path()))

// Construct a tarball with the binary and produce a layer.
binaryLayerBuf, err := tarBinary(appPath, file, v1.Time{}, platform)
Expand Down Expand Up @@ -788,7 +789,7 @@ func (g *gobuild) buildOne(ctx context.Context, refStr string, base v1.Image, pl
updatePath(cfg, `C:\ko-app`)
cfg.Config.Env = append(cfg.Config.Env, `KO_DATA_PATH=C:\var\run\ko`)
} else {
updatePath(cfg, appPath)
updatePath(cfg, appDir)
cfg.Config.Env = append(cfg.Config.Env, "KO_DATA_PATH="+kodataRoot)
}
cfg.Author = "github.com/google/ko"
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 @@ -536,7 +536,7 @@ func validateImage(t *testing.T, img v1.Image, baseLayers int64, creationTime v1
pathValue := strings.TrimPrefix(envVar, "PATH=")
pathEntries := strings.Split(pathValue, ":")
for _, pathEntry := range pathEntries {
if pathEntry == "/ko-app/test" {
if pathEntry == "/ko-app" {
found = true
}
}
Expand Down

0 comments on commit 2adcadd

Please sign in to comment.