Skip to content

Commit

Permalink
pkg/archive: deprecate CanonicalTarNameForPath
Browse files Browse the repository at this point in the history
Commit d597584 changed this function to
be a wrapper for `filepath.ToSlash`. It was used in the CLI for the classic
builder, but is no longer used in our codebase.

However, there may still be some consumers that copied the CLI code for the
classic builder that didn't synchronise their implementation yet, so let's
deprecate this function to give them a warning that they should no longer
use this.

Signed-off-by: Sebastiaan van Stijn <[email protected]>
  • Loading branch information
thaJeztah committed Jun 16, 2024
1 parent d1273b2 commit 92b8d93
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/archive/archive.go
Original file line number Diff line number Diff line change
Expand Up @@ -541,8 +541,10 @@ func newTarAppender(idMapping idtools.IdentityMapping, writer io.Writer, chownOp
}

// CanonicalTarNameForPath canonicalizes relativePath to a POSIX-style path using
// forward slashes. It is an alias for filepath.ToSlash, which is a no-op on
// forward slashes. It is an alias for [filepath.ToSlash], which is a no-op on
// Linux and Unix.
//
// Deprecated: use [filepath.ToSlash]. This function will be removed in the next release.
func CanonicalTarNameForPath(relativePath string) string {
return filepath.ToSlash(relativePath)
}
Expand Down

0 comments on commit 92b8d93

Please sign in to comment.