Skip to content

Commit

Permalink
pkg/bindings/images.Build(): slashify "dockerfile" values, too
Browse files Browse the repository at this point in the history
When the Dockerfile isn't in the root directory of the build context,
the client supplies its pathname to the server, but it needs to do so
using "/" as the path separator, not the client OS's path separator.

CI can't test Windows clients, so
[NO NEW TESTS NEEDED]

Signed-off-by: Nalin Dahyabhai <[email protected]>
  • Loading branch information
nalind committed Feb 2, 2022
1 parent 21a8ee9 commit 725a6f8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/bindings/images/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ func Build(ctx context.Context, containerFiles []string, options entities.BuildO
}

tarContent := []string{options.ContextDirectory}
newContainerFiles := []string{}
newContainerFiles := []string{} // dockerfile paths, relative to context dir, ToSlash()ed

dontexcludes := []string{"!Dockerfile", "!Containerfile", "!.dockerignore", "!.containerignore"}
for _, c := range containerFiles {
Expand Down Expand Up @@ -380,7 +380,7 @@ func Build(ctx context.Context, containerFiles []string, options entities.BuildO
tarContent = append(tarContent, containerfile)
}
}
newContainerFiles = append(newContainerFiles, containerfile)
newContainerFiles = append(newContainerFiles, filepath.ToSlash(containerfile))
}
if len(newContainerFiles) > 0 {
cFileJSON, err := json.Marshal(newContainerFiles)
Expand Down

0 comments on commit 725a6f8

Please sign in to comment.