Skip to content

Commit 78f31af

Browse files
committed
Reorder to separate generic from windows-specific code
Specifically, all the functions above applyWindowsLayer are actually used by the (generic) applyNaive code, while the functions below this point are specific to applyWindowsLayer. Signed-off-by: Paul "TBBle" Hampson <[email protected]>
1 parent 3e47cdf commit 78f31af

1 file changed

Lines changed: 11 additions & 11 deletions

File tree

archive/tar_windows.go

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,17 @@ func setxattr(path, key, value string) error {
131131
return errors.New("xattrs not supported on Windows")
132132
}
133133

134+
func copyDirInfo(fi os.FileInfo, path string) error {
135+
if err := os.Chmod(path, fi.Mode()); err != nil {
136+
return errors.Wrapf(err, "failed to chmod %s", path)
137+
}
138+
return nil
139+
}
140+
141+
func copyUpXAttrs(dst, src string) error {
142+
return nil
143+
}
144+
134145
// applyWindowsLayer applies a tar stream of an OCI style diff tar of a Windows
135146
// layer using the hcsshim layer writer and backup streams.
136147
// See https://github.com/opencontainers/image-spec/blob/master/layer.md#applying-changesets
@@ -248,14 +259,3 @@ func tarToBackupStreamWithMutatedFiles(buf *bufio.Writer, w io.Writer, t *tar.Re
248259

249260
return backuptar.WriteBackupStreamFromTarFile(buf, t, hdr)
250261
}
251-
252-
func copyDirInfo(fi os.FileInfo, path string) error {
253-
if err := os.Chmod(path, fi.Mode()); err != nil {
254-
return errors.Wrapf(err, "failed to chmod %s", path)
255-
}
256-
return nil
257-
}
258-
259-
func copyUpXAttrs(dst, src string) error {
260-
return nil
261-
}

0 commit comments

Comments
 (0)