コード例 #1
0
ファイル: aufs.go プロジェクト: leobcn/docker
func (a *Driver) applyDiff(id string, diff archive.Reader) error {
	dir := path.Join(a.rootPath(), "diff", id)
	if err := chrootarchive.UntarUncompressed(diff, dir, &archive.TarOptions{
		UIDMaps: a.uidMaps,
		GIDMaps: a.gidMaps,
	}); err != nil {
		return err
	}

	// show invalid whiteouts warning.
	files, err := ioutil.ReadDir(path.Join(dir, archive.WhiteoutLinkDir))
	if err == nil && len(files) > 0 {
		logrus.Warnf("Archive contains aufs hardlink references that are not supported.")
	}
	return nil
}
コード例 #2
0
ファイル: unionfs.go プロジェクト: SuhasAnand/openstorage
// ApplyDiff extracts the changeset from the given diff into the
// layer with the specified id and parent, returning the size of the
// new layer in bytes.
// The archive.Reader must be an uncompressed stream.
func (d *Driver) ApplyDiff(id string, parent string, diff archive.Reader) (size int64, err error) {
	dir := path.Join(physPath, id)

	if err := chrootarchive.UntarUncompressed(diff, dir, nil); err != nil {
		logrus.Warnf("Error while applying diff to %s: %v", id, err)
		return 0, err
	}

	// show invalid whiteouts warning.
	files, err := ioutil.ReadDir(path.Join(dir, archive.WhiteoutLinkDir))
	if err == nil && len(files) > 0 {
		logrus.Warnf("Archive contains aufs hardlink references that are not supported.")
	}

	return d.DiffSize(id, parent)
}
コード例 #3
0
ファイル: aufs.go プロジェクト: ungureanuvladvictor/docker
func (a *Driver) applyDiff(id string, diff archive.Reader) error {
	return chrootarchive.UntarUncompressed(diff, path.Join(a.rootPath(), "diff", id), &archive.TarOptions{
		UIDMaps: a.uidMaps,
		GIDMaps: a.gidMaps,
	})
}
コード例 #4
0
ファイル: aufs.go プロジェクト: vito/garden-linux-release
func (a *Driver) applyDiff(id string, diff archive.ArchiveReader) error {
	return chrootarchive.UntarUncompressed(diff, path.Join(a.rootPath(), "diff", id), nil)
}