From 417d28901bd8ad19ab4c1b6e94a33ca3232bf9a7 Mon Sep 17 00:00:00 2001 From: Daniel J Walsh Date: Thu, 12 Jan 2017 14:00:28 -0500 Subject: [PATCH] Remove "docker" strings from container storage We want to make sure that content created out of container storage does not refer to docker. Signed-off-by: Daniel J Walsh --- archive/archive.go | 2 +- archive/diff.go | 2 +- archive/example_changes.go | 4 ++-- chrootarchive/archive_unix.go | 6 +++--- chrootarchive/diff_unix.go | 6 +++--- chrootarchive/diff_windows.go | 4 ++-- chrootarchive/init_unix.go | 4 ++-- 7 files changed, 14 insertions(+), 14 deletions(-) diff --git a/archive/archive.go b/archive/archive.go index 98197a0..1b78830 100644 --- a/archive/archive.go +++ b/archive/archive.go @@ -220,7 +220,7 @@ func CompressStream(dest io.Writer, compression Compression) (io.WriteCloser, er return writeBufWrapper, nil case Bzip2, Xz: // archive/bzip2 does not support writing, and there is no xz support at all - // However, this is not a problem as docker only currently generates gzipped tars + // However, this is not a problem as we only currently generates gzipped tars return nil, fmt.Errorf("Unsupported compression format %s", (&compression).Extension()) default: return nil, fmt.Errorf("Unsupported compression format %s", (&compression).Extension()) diff --git a/archive/diff.go b/archive/diff.go index eba7173..c8d09d3 100644 --- a/archive/diff.go +++ b/archive/diff.go @@ -106,7 +106,7 @@ func UnpackLayer(dest string, layer Reader, options *TarOptions) (size int64, er basename := filepath.Base(hdr.Name) aufsHardlinks[basename] = hdr if aufsTempdir == "" { - if aufsTempdir, err = ioutil.TempDir("", "dockerplnk"); err != nil { + if aufsTempdir, err = ioutil.TempDir("", "storageplnk"); err != nil { return 0, err } defer os.RemoveAll(aufsTempdir) diff --git a/archive/example_changes.go b/archive/example_changes.go index ef33944..549f07f 100644 --- a/archive/example_changes.go +++ b/archive/example_changes.go @@ -39,7 +39,7 @@ func main() { if len(*flNewDir) == 0 { var err error - newDir, err = ioutil.TempDir("", "docker-test-newDir") + newDir, err = ioutil.TempDir("", "storage-test-newDir") if err != nil { log.Fatal(err) } @@ -52,7 +52,7 @@ func main() { } if len(*flOldDir) == 0 { - oldDir, err := ioutil.TempDir("", "docker-test-oldDir") + oldDir, err := ioutil.TempDir("", "storage-test-oldDir") if err != nil { log.Fatal(err) } diff --git a/chrootarchive/archive_unix.go b/chrootarchive/archive_unix.go index 5b26a52..e04ed78 100644 --- a/chrootarchive/archive_unix.go +++ b/chrootarchive/archive_unix.go @@ -16,7 +16,7 @@ import ( "github.com/containers/storage/pkg/reexec" ) -// untar is the entry-point for docker-untar on re-exec. This is not used on +// untar is the entry-point for storage-untar on re-exec. This is not used on // Windows as it does not support chroot, hence no point sandboxing through // chroot and rexec. func untar() { @@ -57,7 +57,7 @@ func invokeUnpack(decompressedArchive io.Reader, dest string, options *archive.T return fmt.Errorf("Untar pipe failure: %v", err) } - cmd := reexec.Command("docker-untar", dest) + cmd := reexec.Command("storage-untar", dest) cmd.Stdin = decompressedArchive cmd.ExtraFiles = append(cmd.ExtraFiles, r) @@ -75,7 +75,7 @@ func invokeUnpack(decompressedArchive io.Reader, dest string, options *archive.T w.Close() if err := cmd.Wait(); err != nil { - // when `xz -d -c -q | docker-untar ...` failed on docker-untar side, + // when `xz -d -c -q | storage-untar ...` failed on storage-untar side, // we need to exhaust `xz`'s output, otherwise the `xz` side will be // pending on write pipe forever io.Copy(ioutil.Discard, decompressedArchive) diff --git a/chrootarchive/diff_unix.go b/chrootarchive/diff_unix.go index 23daa72..3a9f9a8 100644 --- a/chrootarchive/diff_unix.go +++ b/chrootarchive/diff_unix.go @@ -21,7 +21,7 @@ type applyLayerResponse struct { LayerSize int64 `json:"layerSize"` } -// applyLayer is the entry-point for docker-applylayer on re-exec. This is not +// applyLayer is the entry-point for storage-applylayer on re-exec. This is not // used on Windows as it does not support chroot, hence no point sandboxing // through chroot and rexec. func applyLayer() { @@ -49,7 +49,7 @@ func applyLayer() { fatal(err) } - if tmpDir, err = ioutil.TempDir("/", "temp-docker-extract"); err != nil { + if tmpDir, err = ioutil.TempDir("/", "temp-storage-extract"); err != nil { fatal(err) } @@ -98,7 +98,7 @@ func applyLayerHandler(dest string, layer archive.Reader, options *archive.TarOp return 0, fmt.Errorf("ApplyLayer json encode: %v", err) } - cmd := reexec.Command("docker-applyLayer", dest) + cmd := reexec.Command("storage-applyLayer", dest) cmd.Stdin = layer cmd.Env = append(cmd.Env, fmt.Sprintf("OPT=%s", data)) diff --git a/chrootarchive/diff_windows.go b/chrootarchive/diff_windows.go index cfada9b..534d270 100644 --- a/chrootarchive/diff_windows.go +++ b/chrootarchive/diff_windows.go @@ -29,9 +29,9 @@ func applyLayerHandler(dest string, layer archive.Reader, options *archive.TarOp layer = decompressed } - tmpDir, err := ioutil.TempDir(os.Getenv("temp"), "temp-docker-extract") + tmpDir, err := ioutil.TempDir(os.Getenv("temp"), "temp-storage-extract") if err != nil { - return 0, fmt.Errorf("ApplyLayer failed to create temp-docker-extract under %s. %s", dest, err) + return 0, fmt.Errorf("ApplyLayer failed to create temp-storage-extract under %s. %s", dest, err) } s, err := archive.UnpackLayer(dest, layer, nil) diff --git a/chrootarchive/init_unix.go b/chrootarchive/init_unix.go index 7b8a46f..21cd879 100644 --- a/chrootarchive/init_unix.go +++ b/chrootarchive/init_unix.go @@ -12,8 +12,8 @@ import ( ) func init() { - reexec.Register("docker-applyLayer", applyLayer) - reexec.Register("docker-untar", untar) + reexec.Register("storage-applyLayer", applyLayer) + reexec.Register("storage-untar", untar) } func fatal(err error) {