Vendor in latest containers-storage to add devmapper support

containers/storage and storage.conf now support flags to allow users
to setup containers/storage to run on devicemapper.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
This commit is contained in:
Daniel J Walsh
2018-05-18 12:04:00 -04:00
parent 7e9a664764
commit 597b6bd204
11 changed files with 154 additions and 20 deletions

View File

@@ -9,7 +9,6 @@ import (
"os"
"os/exec"
"path/filepath"
"reflect"
"strings"
"github.com/pkg/errors"
@@ -31,9 +30,6 @@ var (
)
func validateLVMConfig(cfg directLVMConfig) error {
if reflect.DeepEqual(cfg, directLVMConfig{}) {
return nil
}
if cfg.Device == "" {
return errMissingSetupDevice
}

View File

@@ -703,6 +703,10 @@ func (devices *DeviceSet) startDeviceDeletionWorker() {
return
}
// Cleanup right away if there are any leaked devices. Note this
// could cause some slowdown for process startup, if there were
// Leaked devices
devices.cleanupDeletedDevices()
logrus.Debug("devmapper: Worker to cleanup deleted devices started")
for range devices.deletionWorkerTicker.C {
devices.cleanupDeletedDevices()
@@ -2652,6 +2656,7 @@ func NewDeviceSet(root string, doInit bool, options []string, uidMaps, gidMaps [
foundBlkDiscard := false
var lvmSetupConfig directLVMConfig
testMode := false
for _, option := range options {
key, val, err := parsers.ParseKeyValueOpt(option)
if err != nil {
@@ -2801,13 +2806,20 @@ func NewDeviceSet(root string, doInit bool, options []string, uidMaps, gidMaps [
devicemapper.LogInit(devicemapper.DefaultLogger{
Level: int(level),
})
case "test":
testMode, err = strconv.ParseBool(val)
if err != nil {
return nil, err
}
default:
return nil, fmt.Errorf("devmapper: Unknown option %s", key)
}
}
if err := validateLVMConfig(lvmSetupConfig); err != nil {
return nil, err
if !testMode {
if err := validateLVMConfig(lvmSetupConfig); err != nil {
return nil, err
}
}
devices.lvmSetupConfig = lvmSetupConfig