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 <dwalsh@redhat.com>
This commit is contained in:
parent
c4bcd1cf17
commit
417d28901b
7 changed files with 14 additions and 14 deletions
|
@ -220,7 +220,7 @@ func CompressStream(dest io.Writer, compression Compression) (io.WriteCloser, er
|
||||||
return writeBufWrapper, nil
|
return writeBufWrapper, nil
|
||||||
case Bzip2, Xz:
|
case Bzip2, Xz:
|
||||||
// archive/bzip2 does not support writing, and there is no xz support at all
|
// 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())
|
return nil, fmt.Errorf("Unsupported compression format %s", (&compression).Extension())
|
||||||
default:
|
default:
|
||||||
return nil, fmt.Errorf("Unsupported compression format %s", (&compression).Extension())
|
return nil, fmt.Errorf("Unsupported compression format %s", (&compression).Extension())
|
||||||
|
|
|
@ -106,7 +106,7 @@ func UnpackLayer(dest string, layer Reader, options *TarOptions) (size int64, er
|
||||||
basename := filepath.Base(hdr.Name)
|
basename := filepath.Base(hdr.Name)
|
||||||
aufsHardlinks[basename] = hdr
|
aufsHardlinks[basename] = hdr
|
||||||
if aufsTempdir == "" {
|
if aufsTempdir == "" {
|
||||||
if aufsTempdir, err = ioutil.TempDir("", "dockerplnk"); err != nil {
|
if aufsTempdir, err = ioutil.TempDir("", "storageplnk"); err != nil {
|
||||||
return 0, err
|
return 0, err
|
||||||
}
|
}
|
||||||
defer os.RemoveAll(aufsTempdir)
|
defer os.RemoveAll(aufsTempdir)
|
||||||
|
|
|
@ -39,7 +39,7 @@ func main() {
|
||||||
|
|
||||||
if len(*flNewDir) == 0 {
|
if len(*flNewDir) == 0 {
|
||||||
var err error
|
var err error
|
||||||
newDir, err = ioutil.TempDir("", "docker-test-newDir")
|
newDir, err = ioutil.TempDir("", "storage-test-newDir")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
}
|
}
|
||||||
|
@ -52,7 +52,7 @@ func main() {
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(*flOldDir) == 0 {
|
if len(*flOldDir) == 0 {
|
||||||
oldDir, err := ioutil.TempDir("", "docker-test-oldDir")
|
oldDir, err := ioutil.TempDir("", "storage-test-oldDir")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,7 +16,7 @@ import (
|
||||||
"github.com/containers/storage/pkg/reexec"
|
"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
|
// Windows as it does not support chroot, hence no point sandboxing through
|
||||||
// chroot and rexec.
|
// chroot and rexec.
|
||||||
func untar() {
|
func untar() {
|
||||||
|
@ -57,7 +57,7 @@ func invokeUnpack(decompressedArchive io.Reader, dest string, options *archive.T
|
||||||
return fmt.Errorf("Untar pipe failure: %v", err)
|
return fmt.Errorf("Untar pipe failure: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
cmd := reexec.Command("docker-untar", dest)
|
cmd := reexec.Command("storage-untar", dest)
|
||||||
cmd.Stdin = decompressedArchive
|
cmd.Stdin = decompressedArchive
|
||||||
|
|
||||||
cmd.ExtraFiles = append(cmd.ExtraFiles, r)
|
cmd.ExtraFiles = append(cmd.ExtraFiles, r)
|
||||||
|
@ -75,7 +75,7 @@ func invokeUnpack(decompressedArchive io.Reader, dest string, options *archive.T
|
||||||
w.Close()
|
w.Close()
|
||||||
|
|
||||||
if err := cmd.Wait(); err != nil {
|
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
|
// we need to exhaust `xz`'s output, otherwise the `xz` side will be
|
||||||
// pending on write pipe forever
|
// pending on write pipe forever
|
||||||
io.Copy(ioutil.Discard, decompressedArchive)
|
io.Copy(ioutil.Discard, decompressedArchive)
|
||||||
|
|
|
@ -21,7 +21,7 @@ type applyLayerResponse struct {
|
||||||
LayerSize int64 `json:"layerSize"`
|
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
|
// used on Windows as it does not support chroot, hence no point sandboxing
|
||||||
// through chroot and rexec.
|
// through chroot and rexec.
|
||||||
func applyLayer() {
|
func applyLayer() {
|
||||||
|
@ -49,7 +49,7 @@ func applyLayer() {
|
||||||
fatal(err)
|
fatal(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if tmpDir, err = ioutil.TempDir("/", "temp-docker-extract"); err != nil {
|
if tmpDir, err = ioutil.TempDir("/", "temp-storage-extract"); err != nil {
|
||||||
fatal(err)
|
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)
|
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.Stdin = layer
|
||||||
cmd.Env = append(cmd.Env, fmt.Sprintf("OPT=%s", data))
|
cmd.Env = append(cmd.Env, fmt.Sprintf("OPT=%s", data))
|
||||||
|
|
||||||
|
|
|
@ -29,9 +29,9 @@ func applyLayerHandler(dest string, layer archive.Reader, options *archive.TarOp
|
||||||
layer = decompressed
|
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 {
|
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)
|
s, err := archive.UnpackLayer(dest, layer, nil)
|
||||||
|
|
|
@ -12,8 +12,8 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
reexec.Register("docker-applyLayer", applyLayer)
|
reexec.Register("storage-applyLayer", applyLayer)
|
||||||
reexec.Register("docker-untar", untar)
|
reexec.Register("storage-untar", untar)
|
||||||
}
|
}
|
||||||
|
|
||||||
func fatal(err error) {
|
func fatal(err error) {
|
||||||
|
|
Loading…
Reference in a new issue