diff options
author | Valentin Rothberg <rothberg@redhat.com> | 2019-10-14 19:37:37 +0200 |
---|---|---|
committer | Valentin Rothberg <rothberg@redhat.com> | 2019-10-14 19:37:37 +0200 |
commit | 94489e0b0e376545c71343a6af37f24809fd5148 (patch) | |
tree | c6d16e3fa9527ebfb05b44643d6b007dac40c2e8 /vendor | |
parent | 3e45d0730b4a17a91912eb161de30cb88e76bb33 (diff) | |
download | podman-94489e0b0e376545c71343a6af37f24809fd5148.tar.gz podman-94489e0b0e376545c71343a6af37f24809fd5148.tar.bz2 podman-94489e0b0e376545c71343a6af37f24809fd5148.zip |
vendor github.com/containers/storage@v1.13.5
* Do not discard errors when panicing on lockfile open
* config: drop skip_mount_home
* storage: drop ostree deduplication
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
Diffstat (limited to 'vendor')
15 files changed, 5 insertions, 309 deletions
diff --git a/vendor/github.com/containers/storage/.cirrus.yml b/vendor/github.com/containers/storage/.cirrus.yml index a823bab55..619e077d0 100644 --- a/vendor/github.com/containers/storage/.cirrus.yml +++ b/vendor/github.com/containers/storage/.cirrus.yml @@ -82,7 +82,7 @@ lint_task: build_script: | echo "deb http://deb.debian.org/debian stretch-backports main" > /etc/apt/sources.list.d/backports.list apt-get update - apt-get install -y libbtrfs-dev libostree-dev libdevmapper-dev + apt-get install -y libbtrfs-dev libdevmapper-dev test_script: make lint # Update metadata on VM images referenced by this repository state diff --git a/vendor/github.com/containers/storage/.golangci.yml b/vendor/github.com/containers/storage/.golangci.yml index bd8ccfcb1..ec4ebb187 100644 --- a/vendor/github.com/containers/storage/.golangci.yml +++ b/vendor/github.com/containers/storage/.golangci.yml @@ -1,7 +1,5 @@ --- run: - build-tags: - - ostree concurrency: 6 deadline: 5m linters: diff --git a/vendor/github.com/containers/storage/Makefile b/vendor/github.com/containers/storage/Makefile index fa0fddaeb..90e5ca499 100644 --- a/vendor/github.com/containers/storage/Makefile +++ b/vendor/github.com/containers/storage/Makefile @@ -29,7 +29,7 @@ GIT_BRANCH := $(shell git rev-parse --abbrev-ref HEAD 2>/dev/null) GIT_BRANCH_CLEAN := $(shell echo $(GIT_BRANCH) | sed -e "s/[^[:alnum:]]/-/g") EPOCH_TEST_COMMIT := 0418ebf59f9e1f564831c0ba9378b7f8e40a1c73 NATIVETAGS := -AUTOTAGS := $(shell ./hack/btrfs_tag.sh) $(shell ./hack/libdm_tag.sh) $(shell ./hack/ostree_tag.sh) +AUTOTAGS := $(shell ./hack/btrfs_tag.sh) $(shell ./hack/libdm_tag.sh) BUILDFLAGS := -tags "$(AUTOTAGS) $(TAGS)" $(FLAGS) GO ?= go diff --git a/vendor/github.com/containers/storage/VERSION b/vendor/github.com/containers/storage/VERSION index 80138e714..43ded9062 100644 --- a/vendor/github.com/containers/storage/VERSION +++ b/vendor/github.com/containers/storage/VERSION @@ -1 +1 @@ -1.13.4 +1.13.5 diff --git a/vendor/github.com/containers/storage/drivers/overlay/overlay.go b/vendor/github.com/containers/storage/drivers/overlay/overlay.go index 032e5b28a..97222fe7a 100644 --- a/vendor/github.com/containers/storage/drivers/overlay/overlay.go +++ b/vendor/github.com/containers/storage/drivers/overlay/overlay.go @@ -26,7 +26,6 @@ import ( "github.com/containers/storage/pkg/idtools" "github.com/containers/storage/pkg/locker" "github.com/containers/storage/pkg/mount" - "github.com/containers/storage/pkg/ostree" "github.com/containers/storage/pkg/parsers" "github.com/containers/storage/pkg/system" units "github.com/docker/go-units" @@ -88,7 +87,6 @@ type overlayOptions struct { imageStores []string quota quota.Quota mountProgram string - ostreeRepo string skipMountHome bool mountOptions string ignoreChownErrors bool @@ -108,7 +106,6 @@ type Driver struct { supportsDType bool usingMetacopy bool locker *locker.Locker - convert map[string]bool } var ( @@ -234,12 +231,6 @@ func Init(home string, options graphdriver.Options) (graphdriver.Driver, error) } } - if opts.ostreeRepo != "" { - if err := ostree.CreateOSTreeRepository(opts.ostreeRepo, rootUID, rootGID); err != nil { - return nil, err - } - } - d := &Driver{ name: "overlay", home: home, @@ -251,7 +242,6 @@ func Init(home string, options graphdriver.Options) (graphdriver.Driver, error) usingMetacopy: usingMetacopy, locker: locker.New(), options: *opts, - convert: make(map[string]bool), } d.naiveDiff = graphdriver.NewNaiveDiffDriver(d, graphdriver.NewNaiveLayerIDMapUpdater(d)) @@ -316,24 +306,12 @@ func parseOptions(options []string) (*overlayOptions, error) { return nil, fmt.Errorf("overlay: can't stat program %s: %v", val, err) } o.mountProgram = val - case "overlay2.ostree_repo", "overlay.ostree_repo", ".ostree_repo": - logrus.Debugf("overlay: ostree_repo=%s", val) - if !ostree.OstreeSupport() { - return nil, fmt.Errorf("overlay: ostree_repo specified but support for ostree is missing") - } - o.ostreeRepo = val case ".ignore_chown_errors", "overlay2.ignore_chown_errors", "overlay.ignore_chown_errors": logrus.Debugf("overlay: ignore_chown_errors=%s", val) o.ignoreChownErrors, err = strconv.ParseBool(val) if err != nil { return nil, err } - case "overlay2.skip_mount_home", "overlay.skip_mount_home", ".skip_mount_home": - logrus.Debugf("overlay: skip_mount_home=%s", val) - o.skipMountHome, err = strconv.ParseBool(val) - if err != nil { - return nil, err - } default: return nil, fmt.Errorf("overlay: Unknown option %s", key) } @@ -556,10 +534,6 @@ func (d *Driver) Create(id, parent string, opts *graphdriver.CreateOpts) (retErr } } - if d.options.ostreeRepo != "" { - d.convert[id] = true - } - return d.create(id, parent, opts) } @@ -766,11 +740,6 @@ func (d *Driver) Remove(id string) error { d.locker.Lock(id) defer d.locker.Unlock(id) - // Ignore errors, we don't want to fail if the ostree branch doesn't exist, - if d.options.ostreeRepo != "" { - ostree.DeleteOSTree(d.options.ostreeRepo, id) - } - dir := d.dir(id) lid, err := ioutil.ReadFile(path.Join(dir, "link")) if err == nil { @@ -1125,13 +1094,6 @@ func (d *Driver) ApplyDiff(id, parent string, options graphdriver.ApplyDiffOpts) return 0, err } - _, convert := d.convert[id] - if convert { - if err := ostree.ConvertToOSTree(d.options.ostreeRepo, applyDir, id); err != nil { - return 0, err - } - } - return directory.Size(applyDir) } diff --git a/vendor/github.com/containers/storage/drivers/vfs/driver.go b/vendor/github.com/containers/storage/drivers/vfs/driver.go index 6c02a45dc..58a1635ae 100644 --- a/vendor/github.com/containers/storage/drivers/vfs/driver.go +++ b/vendor/github.com/containers/storage/drivers/vfs/driver.go @@ -11,7 +11,6 @@ import ( "github.com/containers/storage/drivers" "github.com/containers/storage/pkg/archive" "github.com/containers/storage/pkg/idtools" - "github.com/containers/storage/pkg/ostree" "github.com/containers/storage/pkg/parsers" "github.com/containers/storage/pkg/system" "github.com/opencontainers/selinux/go-selinux/label" @@ -51,11 +50,6 @@ func Init(home string, options graphdriver.Options) (graphdriver.Driver, error) case "vfs.imagestore", ".imagestore": d.homes = append(d.homes, strings.Split(val, ",")...) continue - case "vfs.ostree_repo", ".ostree_repo": - if !ostree.OstreeSupport() { - return nil, fmt.Errorf("vfs: ostree_repo specified but support for ostree is missing") - } - d.ostreeRepo = val case "vfs.mountopt": return nil, fmt.Errorf("vfs driver does not support mount options") case ".ignore_chown_errors", "vfs.ignore_chown_errors": @@ -69,15 +63,6 @@ func Init(home string, options graphdriver.Options) (graphdriver.Driver, error) return nil, fmt.Errorf("vfs driver does not support %s options", key) } } - if d.ostreeRepo != "" { - rootUID, rootGID, err := idtools.GetRootUIDGID(options.UIDMaps, options.GIDMaps) - if err != nil { - return nil, err - } - if err := ostree.CreateOSTreeRepository(d.ostreeRepo, rootUID, rootGID); err != nil { - return nil, err - } - } d.updater = graphdriver.NewNaiveLayerIDMapUpdater(d) d.naiveDiff = graphdriver.NewNaiveDiffDriver(d, d.updater) @@ -92,7 +77,6 @@ type Driver struct { name string homes []string idMappings *idtools.IDMappings - ostreeRepo string ignoreChownErrors bool naiveDiff graphdriver.DiffDriver updater graphdriver.LayerIDMapUpdater @@ -191,11 +175,6 @@ func (d *Driver) create(id, parent string, opts *graphdriver.CreateOpts, ro bool } } - if ro && d.ostreeRepo != "" { - if err := ostree.ConvertToOSTree(d.ostreeRepo, dir, id); err != nil { - return err - } - } return nil } @@ -216,10 +195,6 @@ func (d *Driver) dir(id string) string { // Remove deletes the content from the directory for a given id. func (d *Driver) Remove(id string) error { - if d.ostreeRepo != "" { - // Ignore errors, we don't want to fail if the ostree branch doesn't exist, - ostree.DeleteOSTree(d.ostreeRepo, id) - } return system.EnsureRemoveAll(d.dir(id)) } diff --git a/vendor/github.com/containers/storage/go.mod b/vendor/github.com/containers/storage/go.mod index d8f943d30..934e82ad2 100644 --- a/vendor/github.com/containers/storage/go.mod +++ b/vendor/github.com/containers/storage/go.mod @@ -15,7 +15,6 @@ require ( github.com/opencontainers/go-digest v1.0.0-rc1 github.com/opencontainers/runc v1.0.0-rc8 github.com/opencontainers/selinux v1.2.2 - github.com/ostreedev/ostree-go v0.0.0-20190702140239-759a8c1ac913 github.com/pkg/errors v0.8.1 github.com/pquerna/ffjson v0.0.0-20181028064349-e517b90714f7 github.com/sirupsen/logrus v1.4.2 diff --git a/vendor/github.com/containers/storage/go.sum b/vendor/github.com/containers/storage/go.sum index 159bfdba2..a0e05dd1d 100644 --- a/vendor/github.com/containers/storage/go.sum +++ b/vendor/github.com/containers/storage/go.sum @@ -35,8 +35,6 @@ github.com/opencontainers/runc v1.0.0-rc8 h1:dDCFes8Hj1r/i5qnypONo5jdOme/8HWZC/a github.com/opencontainers/runc v1.0.0-rc8/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rmF59PVA73FjuZG0U= github.com/opencontainers/selinux v1.2.2 h1:Kx9J6eDG5/24A6DtUquGSpJQ+m2MUTahn4FtGEe8bFg= github.com/opencontainers/selinux v1.2.2/go.mod h1:+BLncwf63G4dgOzykXAxcmnFlUaOlkDdmw/CqsW6pjs= -github.com/ostreedev/ostree-go v0.0.0-20190702140239-759a8c1ac913 h1:TnbXhKzrTOyuvWrjI8W6pcoI9XPbLHFXCdN2dtUw7Rw= -github.com/ostreedev/ostree-go v0.0.0-20190702140239-759a8c1ac913/go.mod h1:J6OG6YJVEWopen4avK3VNQSnALmmjvniMmni/YFYAwc= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= diff --git a/vendor/github.com/containers/storage/pkg/config/config.go b/vendor/github.com/containers/storage/pkg/config/config.go index c53f70421..091040140 100644 --- a/vendor/github.com/containers/storage/pkg/config/config.go +++ b/vendor/github.com/containers/storage/pkg/config/config.go @@ -85,11 +85,6 @@ type OptionsConfig struct { RemapGroup string `toml:"remap-group"` // Thinpool container options to be handed to thinpool drivers Thinpool struct{ ThinpoolOptionsConfig } `toml:"thinpool"` - // OSTree repository - OstreeRepo string `toml:"ostree_repo"` - - // Do not create a bind mount on the storage home - SkipMountHome string `toml:"skip_mount_home"` // Alternative program to use for the mount of the file system MountProgram string `toml:"mount_program"` diff --git a/vendor/github.com/containers/storage/pkg/lockfile/lockfile_unix.go b/vendor/github.com/containers/storage/pkg/lockfile/lockfile_unix.go index 1fed414f7..228c8cf24 100644 --- a/vendor/github.com/containers/storage/pkg/lockfile/lockfile_unix.go +++ b/vendor/github.com/containers/storage/pkg/lockfile/lockfile_unix.go @@ -104,7 +104,7 @@ func (l *lockfile) lock(l_type int16, recursive bool) { // If we're the first reference on the lock, we need to open the file again. fd, err := openLock(l.file, l.ro) if err != nil { - panic(fmt.Sprintf("error opening %q", l.file)) + panic(fmt.Sprintf("error opening %q: %v", l.file, err)) } unix.CloseOnExec(fd) l.fd = uintptr(fd) diff --git a/vendor/github.com/containers/storage/pkg/ostree/no_ostree.go b/vendor/github.com/containers/storage/pkg/ostree/no_ostree.go deleted file mode 100644 index bf83ccf25..000000000 --- a/vendor/github.com/containers/storage/pkg/ostree/no_ostree.go +++ /dev/null @@ -1,19 +0,0 @@ -// +build !ostree !cgo - -package ostree - -func OstreeSupport() bool { - return false -} - -func DeleteOSTree(repoLocation, id string) error { - return nil -} - -func CreateOSTreeRepository(repoLocation string, rootUID int, rootGID int) error { - return nil -} - -func ConvertToOSTree(repoLocation, root, id string) error { - return nil -} diff --git a/vendor/github.com/containers/storage/pkg/ostree/ostree.go b/vendor/github.com/containers/storage/pkg/ostree/ostree.go deleted file mode 100644 index 7d324f2b2..000000000 --- a/vendor/github.com/containers/storage/pkg/ostree/ostree.go +++ /dev/null @@ -1,198 +0,0 @@ -// +build ostree,cgo - -package ostree - -import ( - "fmt" - "golang.org/x/sys/unix" - "os" - "path/filepath" - "runtime" - "syscall" - "time" - "unsafe" - - "github.com/containers/storage/pkg/idtools" - "github.com/containers/storage/pkg/system" - glib "github.com/ostreedev/ostree-go/pkg/glibobject" - "github.com/ostreedev/ostree-go/pkg/otbuiltin" - "github.com/pkg/errors" -) - -// #cgo pkg-config: glib-2.0 gobject-2.0 ostree-1 -// #include <glib.h> -// #include <glib-object.h> -// #include <gio/gio.h> -// #include <stdlib.h> -// #include <ostree.h> -// #include <gio/ginputstream.h> -import "C" - -func OstreeSupport() bool { - return true -} - -func fixFiles(dir string, usermode bool) (bool, []string, error) { - var SkipOstree = errors.New("skip ostree deduplication") - - var whiteouts []string - - err := filepath.Walk(dir, func(path string, info os.FileInfo, err error) error { - if info.Mode()&(os.ModeNamedPipe|os.ModeSocket|os.ModeDevice) != 0 { - if !usermode { - stat, ok := info.Sys().(*syscall.Stat_t) - if !ok { - return errors.New("not syscall.Stat_t") - } - - if stat.Rdev == 0 && (stat.Mode&unix.S_IFCHR) != 0 { - whiteouts = append(whiteouts, path) - return nil - } - } - // Skip the ostree deduplication if we encounter a file type that - // ostree does not manage. - return SkipOstree - } - if info.IsDir() { - if usermode { - if err := os.Chmod(path, info.Mode()|0700); err != nil { - return err - } - } - } else if usermode && (info.Mode().IsRegular()) { - if err := os.Chmod(path, info.Mode()|0600); err != nil { - return err - } - } - return nil - }) - if err == SkipOstree { - return true, nil, nil - } - if err != nil { - return false, nil, err - } - return false, whiteouts, nil -} - -// Create prepares the filesystem for the OSTREE driver and copies the directory for the given id under the parent. -func ConvertToOSTree(repoLocation, root, id string) error { - runtime.LockOSThread() - defer runtime.UnlockOSThread() - repo, err := otbuiltin.OpenRepo(repoLocation) - if err != nil { - return errors.Wrap(err, "could not open the OSTree repository") - } - - skip, whiteouts, err := fixFiles(root, os.Getuid() != 0) - if err != nil { - return errors.Wrap(err, "could not prepare the OSTree directory") - } - if skip { - return nil - } - - if _, err := repo.PrepareTransaction(); err != nil { - return errors.Wrap(err, "could not prepare the OSTree transaction") - } - - if skip { - return nil - } - - commitOpts := otbuiltin.NewCommitOptions() - commitOpts.Timestamp = time.Now() - commitOpts.LinkCheckoutSpeedup = true - commitOpts.Parent = "0000000000000000000000000000000000000000000000000000000000000000" - branch := fmt.Sprintf("containers-storage/%s", id) - - for _, w := range whiteouts { - if err := os.Remove(w); err != nil { - return errors.Wrap(err, "could not delete whiteout file") - } - } - - if _, err := repo.Commit(root, branch, commitOpts); err != nil { - return errors.Wrap(err, "could not commit the layer") - } - - if _, err := repo.CommitTransaction(); err != nil { - return errors.Wrap(err, "could not complete the OSTree transaction") - } - - if err := system.EnsureRemoveAll(root); err != nil { - return errors.Wrap(err, "could not delete layer") - } - - checkoutOpts := otbuiltin.NewCheckoutOptions() - checkoutOpts.RequireHardlinks = true - checkoutOpts.Whiteouts = false - if err := otbuiltin.Checkout(repoLocation, root, branch, checkoutOpts); err != nil { - return errors.Wrap(err, "could not checkout from OSTree") - } - - for _, w := range whiteouts { - if err := unix.Mknod(w, unix.S_IFCHR, 0); err != nil { - return errors.Wrap(err, "could not recreate whiteout file") - } - } - return nil -} - -func CreateOSTreeRepository(repoLocation string, rootUID int, rootGID int) error { - runtime.LockOSThread() - defer runtime.UnlockOSThread() - - _, err := os.Stat(repoLocation) - if err != nil && !os.IsNotExist(err) { - return err - } else if err != nil { - if err := idtools.MkdirAllAs(repoLocation, 0700, rootUID, rootGID); err != nil { - return errors.Wrap(err, "could not create OSTree repository directory: %v") - } - - if _, err := otbuiltin.Init(repoLocation, otbuiltin.NewInitOptions()); err != nil { - return errors.Wrap(err, "could not create OSTree repository") - } - } - return nil -} - -func openRepo(path string) (*C.struct_OstreeRepo, error) { - var cerr *C.GError - cpath := C.CString(path) - defer C.free(unsafe.Pointer(cpath)) - pathc := C.g_file_new_for_path(cpath) - defer C.g_object_unref(C.gpointer(pathc)) - repo := C.ostree_repo_new(pathc) - r := glib.GoBool(glib.GBoolean(C.ostree_repo_open(repo, nil, &cerr))) - if !r { - C.g_object_unref(C.gpointer(repo)) - return nil, glib.ConvertGError(glib.ToGError(unsafe.Pointer(cerr))) - } - return repo, nil -} - -func DeleteOSTree(repoLocation, id string) error { - runtime.LockOSThread() - defer runtime.UnlockOSThread() - - repo, err := openRepo(repoLocation) - if err != nil { - return err - } - defer C.g_object_unref(C.gpointer(repo)) - - branch := fmt.Sprintf("containers-storage/%s", id) - - cbranch := C.CString(branch) - defer C.free(unsafe.Pointer(cbranch)) - - var cerr *C.GError - r := glib.GoBool(glib.GBoolean(C.ostree_repo_set_ref_immediate(repo, nil, cbranch, nil, nil, &cerr))) - if !r { - return glib.ConvertGError(glib.ToGError(unsafe.Pointer(cerr))) - } - return nil -} diff --git a/vendor/github.com/containers/storage/storage.conf b/vendor/github.com/containers/storage/storage.conf index 3e7bf62f0..efd46eefb 100644 --- a/vendor/github.com/containers/storage/storage.conf +++ b/vendor/github.com/containers/storage/storage.conf @@ -61,13 +61,6 @@ mountopt = "nodev" # remap-user = "storage" # remap-group = "storage" -# If specified, use OSTree to deduplicate files with the overlay backend. -ostree_repo = "" - -# Set to skip a PRIVATE bind mount on the storage home directory. Only supported by -# certain container storage drivers (overlay). -skip_mount_home = "false" - [storage.options.thinpool] # Storage Options for thinpool diff --git a/vendor/github.com/containers/storage/store.go b/vendor/github.com/containers/storage/store.go index af69a4b2d..6e4bd4ee0 100644 --- a/vendor/github.com/containers/storage/store.go +++ b/vendor/github.com/containers/storage/store.go @@ -3357,12 +3357,6 @@ func ReloadConfigurationFile(configFile string, storeOptions *StoreOptions) { if config.Storage.Options.Size != "" { storeOptions.GraphDriverOptions = append(storeOptions.GraphDriverOptions, fmt.Sprintf("%s.size=%s", config.Storage.Driver, config.Storage.Options.Size)) } - if config.Storage.Options.OstreeRepo != "" { - storeOptions.GraphDriverOptions = append(storeOptions.GraphDriverOptions, fmt.Sprintf("%s.ostree_repo=%s", config.Storage.Driver, config.Storage.Options.OstreeRepo)) - } - if config.Storage.Options.SkipMountHome != "" { - storeOptions.GraphDriverOptions = append(storeOptions.GraphDriverOptions, fmt.Sprintf("%s.skip_mount_home=%s", config.Storage.Driver, config.Storage.Options.SkipMountHome)) - } if config.Storage.Options.MountProgram != "" { storeOptions.GraphDriverOptions = append(storeOptions.GraphDriverOptions, fmt.Sprintf("%s.mount_program=%s", config.Storage.Driver, config.Storage.Options.MountProgram)) } diff --git a/vendor/modules.txt b/vendor/modules.txt index c422598fb..712bfb69a 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -116,7 +116,7 @@ github.com/containers/psgo/internal/proc github.com/containers/psgo/internal/process github.com/containers/psgo/internal/cgroups github.com/containers/psgo/internal/host -# github.com/containers/storage v1.13.4 +# github.com/containers/storage v1.13.5 github.com/containers/storage github.com/containers/storage/pkg/archive github.com/containers/storage/pkg/chrootarchive @@ -155,7 +155,6 @@ github.com/containers/storage/pkg/loopback github.com/containers/storage/drivers/overlayutils github.com/containers/storage/drivers/quota github.com/containers/storage/pkg/fsutils -github.com/containers/storage/pkg/ostree github.com/containers/storage/drivers/copy # github.com/coreos/go-iptables v0.4.2 github.com/coreos/go-iptables/iptables |