Merge pull request #13120 from nalind/slashify-dockerfile

pkg/bindings/images.Build(): slashify "dockerfile" values, too
This commit is contained in:
OpenShift Merge Robot 2022-02-03 04:01:15 -05:00 committed by GitHub
commit f2263fade4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

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