Explorar o código

build: replace uses of archive.CanonicalTarNameForPath

This function is an alias for filepath.IsAbs and we are considering deprecating
and/or removing this function in the archive package, so removing its uses
helps transitioning if we decide to deprecate and/or remove it.

[docker/cli@fb0788f] also added a normalize step in TrimBuildFilesFromExcludes,
so that callers are not _required_ to first normalize the path, so the
normalizeation may be redunant, but keeping the normalization as this variable
is used further down the code.

[docker/cli@fb0788f]: https://github.com/docker/cli/commit/fb0788f18fcd90dbe95a7c7324d2c22e05050d71

Signed-off-by: Sebastiaan van Stijn <[email protected]>
Sebastiaan van Stijn hai 1 ano
pai
achega
5ec37d08a5
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      pkg/compose/build_classic.go

+ 1 - 1
pkg/compose/build_classic.go

@@ -124,7 +124,7 @@ func (s *composeService) doBuildClassic(ctx context.Context, project *types.Proj
 		}
 
 		// And canonicalize dockerfile name to a platform-independent one
-		relDockerfile = archive.CanonicalTarNameForPath(relDockerfile)
+		relDockerfile = filepath.ToSlash(relDockerfile)
 
 		excludes = build.TrimBuildFilesFromExcludes(excludes, relDockerfile, false)
 		buildCtx, err = archive.TarWithOptions(contextDir, &archive.TarOptions{