summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNalin Dahyabhai <nalin@redhat.com>2022-02-02 13:48:27 -0500
committerNalin Dahyabhai <nalin@redhat.com>2022-02-03 11:36:15 -0500
commit0c9a8ac073b99af1679d62cd92b3a6b05ab353f6 (patch)
tree46089e99e6787eac7ebfe9ec459c92d802a60206
parent18348c0b695d16002a199a770c0c2cf7fe89ca4b (diff)
downloadpodman-0c9a8ac073b99af1679d62cd92b3a6b05ab353f6.tar.gz
podman-0c9a8ac073b99af1679d62cd92b3a6b05ab353f6.tar.bz2
podman-0c9a8ac073b99af1679d62cd92b3a6b05ab353f6.zip
pkg/bindings/images.Build(): slashify "dockerfile" values, too
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 <nalin@redhat.com>
-rw-r--r--pkg/bindings/images/build.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/pkg/bindings/images/build.go b/pkg/bindings/images/build.go
index b7220f5c5..a363f2c6e 100644
--- a/pkg/bindings/images/build.go
+++ b/pkg/bindings/images/build.go
@@ -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 {
@@ -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)