1
0
mirror of https://github.com/ko-build/ko.git synced 2025-03-17 20:47:51 +02:00

Fix regression in adding /ko-app to PATH (#448)

This commit is contained in:
Jason Hall 2021-09-27 11:00:25 -04:00 committed by GitHub
parent 5a8663b58d
commit 2adcadd918
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 3 deletions

View File

@ -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)
@ -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"

View File

@ -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
}
}