Bumping k8s dependencies to 1.13
This commit is contained in:
20
vendor/k8s.io/kubernetes/pkg/volume/testing/BUILD
generated
vendored
20
vendor/k8s.io/kubernetes/pkg/volume/testing/BUILD
generated
vendored
@@ -14,23 +14,23 @@ go_library(
|
||||
importpath = "k8s.io/kubernetes/pkg/volume/testing",
|
||||
deps = [
|
||||
"//pkg/cloudprovider:go_default_library",
|
||||
"//pkg/util/io:go_default_library",
|
||||
"//pkg/util/mount:go_default_library",
|
||||
"//pkg/util/strings:go_default_library",
|
||||
"//pkg/volume:go_default_library",
|
||||
"//pkg/volume/util:go_default_library",
|
||||
"//pkg/volume/util/recyclerclient:go_default_library",
|
||||
"//pkg/volume/util/volumepathhandler:go_default_library",
|
||||
"//staging/src/k8s.io/api/authentication/v1:go_default_library",
|
||||
"//staging/src/k8s.io/api/core/v1:go_default_library",
|
||||
"//staging/src/k8s.io/apimachinery/pkg/api/resource:go_default_library",
|
||||
"//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
|
||||
"//staging/src/k8s.io/apimachinery/pkg/types:go_default_library",
|
||||
"//staging/src/k8s.io/apimachinery/pkg/util/uuid:go_default_library",
|
||||
"//staging/src/k8s.io/client-go/kubernetes:go_default_library",
|
||||
"//staging/src/k8s.io/client-go/tools/record:go_default_library",
|
||||
"//staging/src/k8s.io/client-go/util/testing:go_default_library",
|
||||
"//staging/src/k8s.io/csi-api/pkg/client/clientset/versioned:go_default_library",
|
||||
"//vendor/github.com/stretchr/testify/mock:go_default_library",
|
||||
"//vendor/k8s.io/api/authentication/v1:go_default_library",
|
||||
"//vendor/k8s.io/api/core/v1:go_default_library",
|
||||
"//vendor/k8s.io/apimachinery/pkg/api/resource:go_default_library",
|
||||
"//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
|
||||
"//vendor/k8s.io/apimachinery/pkg/types:go_default_library",
|
||||
"//vendor/k8s.io/apimachinery/pkg/util/uuid:go_default_library",
|
||||
"//vendor/k8s.io/client-go/kubernetes:go_default_library",
|
||||
"//vendor/k8s.io/client-go/tools/record:go_default_library",
|
||||
"//vendor/k8s.io/client-go/util/testing:go_default_library",
|
||||
],
|
||||
)
|
||||
|
||||
|
68
vendor/k8s.io/kubernetes/pkg/volume/testing/testing.go
generated
vendored
68
vendor/k8s.io/kubernetes/pkg/volume/testing/testing.go
generated
vendored
@@ -36,8 +36,8 @@ import (
|
||||
clientset "k8s.io/client-go/kubernetes"
|
||||
"k8s.io/client-go/tools/record"
|
||||
utiltesting "k8s.io/client-go/util/testing"
|
||||
csiclientset "k8s.io/csi-api/pkg/client/clientset/versioned"
|
||||
"k8s.io/kubernetes/pkg/cloudprovider"
|
||||
"k8s.io/kubernetes/pkg/util/io"
|
||||
"k8s.io/kubernetes/pkg/util/mount"
|
||||
utilstrings "k8s.io/kubernetes/pkg/util/strings"
|
||||
. "k8s.io/kubernetes/pkg/volume"
|
||||
@@ -50,44 +50,51 @@ import (
|
||||
type fakeVolumeHost struct {
|
||||
rootDir string
|
||||
kubeClient clientset.Interface
|
||||
csiClient csiclientset.Interface
|
||||
pluginMgr VolumePluginMgr
|
||||
cloud cloudprovider.Interface
|
||||
mounter mount.Interface
|
||||
exec mount.Exec
|
||||
writer io.Writer
|
||||
nodeLabels map[string]string
|
||||
nodeName string
|
||||
}
|
||||
|
||||
func NewFakeVolumeHost(rootDir string, kubeClient clientset.Interface, plugins []VolumePlugin) *fakeVolumeHost {
|
||||
return newFakeVolumeHost(rootDir, kubeClient, plugins, nil)
|
||||
return newFakeVolumeHost(rootDir, kubeClient, plugins, nil, nil)
|
||||
}
|
||||
|
||||
func NewFakeVolumeHostWithCloudProvider(rootDir string, kubeClient clientset.Interface, plugins []VolumePlugin, cloud cloudprovider.Interface) *fakeVolumeHost {
|
||||
return newFakeVolumeHost(rootDir, kubeClient, plugins, cloud)
|
||||
return newFakeVolumeHost(rootDir, kubeClient, plugins, cloud, nil)
|
||||
}
|
||||
|
||||
func NewFakeVolumeHostWithNodeLabels(rootDir string, kubeClient clientset.Interface, plugins []VolumePlugin, labels map[string]string) *fakeVolumeHost {
|
||||
volHost := newFakeVolumeHost(rootDir, kubeClient, plugins, nil)
|
||||
volHost := newFakeVolumeHost(rootDir, kubeClient, plugins, nil, nil)
|
||||
volHost.nodeLabels = labels
|
||||
return volHost
|
||||
}
|
||||
|
||||
func NewFakeVolumeHostWithNodeName(rootDir string, kubeClient clientset.Interface, plugins []VolumePlugin, nodeName string) *fakeVolumeHost {
|
||||
volHost := newFakeVolumeHost(rootDir, kubeClient, plugins, nil)
|
||||
func NewFakeVolumeHostWithCSINodeName(rootDir string, kubeClient clientset.Interface, csiClient csiclientset.Interface, plugins []VolumePlugin, nodeName string) *fakeVolumeHost {
|
||||
volHost := newFakeVolumeHost(rootDir, kubeClient, plugins, nil, nil)
|
||||
volHost.nodeName = nodeName
|
||||
volHost.csiClient = csiClient
|
||||
return volHost
|
||||
}
|
||||
|
||||
func newFakeVolumeHost(rootDir string, kubeClient clientset.Interface, plugins []VolumePlugin, cloud cloudprovider.Interface) *fakeVolumeHost {
|
||||
func newFakeVolumeHost(rootDir string, kubeClient clientset.Interface, plugins []VolumePlugin, cloud cloudprovider.Interface, pathToTypeMap map[string]mount.FileType) *fakeVolumeHost {
|
||||
host := &fakeVolumeHost{rootDir: rootDir, kubeClient: kubeClient, cloud: cloud}
|
||||
host.mounter = &mount.FakeMounter{}
|
||||
host.writer = &io.StdWriter{}
|
||||
host.mounter = &mount.FakeMounter{
|
||||
Filesystem: pathToTypeMap,
|
||||
}
|
||||
host.exec = mount.NewFakeExec(nil)
|
||||
host.pluginMgr.InitPlugins(plugins, nil /* prober */, host)
|
||||
return host
|
||||
}
|
||||
|
||||
func NewFakeVolumeHostWithMounterFSType(rootDir string, kubeClient clientset.Interface, plugins []VolumePlugin, pathToTypeMap map[string]mount.FileType) *fakeVolumeHost {
|
||||
volHost := newFakeVolumeHost(rootDir, kubeClient, plugins, nil, pathToTypeMap)
|
||||
return volHost
|
||||
}
|
||||
|
||||
func (f *fakeVolumeHost) GetPluginDir(podUID string) string {
|
||||
return path.Join(f.rootDir, "plugins", podUID)
|
||||
}
|
||||
@@ -116,6 +123,10 @@ func (f *fakeVolumeHost) GetKubeClient() clientset.Interface {
|
||||
return f.kubeClient
|
||||
}
|
||||
|
||||
func (f *fakeVolumeHost) GetCSIClient() csiclientset.Interface {
|
||||
return f.csiClient
|
||||
}
|
||||
|
||||
func (f *fakeVolumeHost) GetCloudProvider() cloudprovider.Interface {
|
||||
return f.cloud
|
||||
}
|
||||
@@ -124,10 +135,6 @@ func (f *fakeVolumeHost) GetMounter(pluginName string) mount.Interface {
|
||||
return f.mounter
|
||||
}
|
||||
|
||||
func (f *fakeVolumeHost) GetWriter() io.Writer {
|
||||
return f.writer
|
||||
}
|
||||
|
||||
func (f *fakeVolumeHost) NewWrapperMounter(volName string, spec Spec, pod *v1.Pod, opts VolumeOptions) (Mounter, error) {
|
||||
// The name of wrapper volume is set to "wrapped_{wrapped_volume_name}"
|
||||
wrapperVolumeName := "wrapped_" + volName
|
||||
@@ -230,6 +237,10 @@ type FakeVolumePlugin struct {
|
||||
LastProvisionerOptions VolumeOptions
|
||||
NewAttacherCallCount int
|
||||
NewDetacherCallCount int
|
||||
VolumeLimits map[string]int64
|
||||
VolumeLimitsError error
|
||||
LimitKey string
|
||||
ProvisionDelaySeconds int
|
||||
|
||||
Mounters []*FakeVolume
|
||||
Unmounters []*FakeVolume
|
||||
@@ -245,6 +256,8 @@ var _ RecyclableVolumePlugin = &FakeVolumePlugin{}
|
||||
var _ DeletableVolumePlugin = &FakeVolumePlugin{}
|
||||
var _ ProvisionableVolumePlugin = &FakeVolumePlugin{}
|
||||
var _ AttachableVolumePlugin = &FakeVolumePlugin{}
|
||||
var _ VolumePluginWithAttachLimits = &FakeVolumePlugin{}
|
||||
var _ DeviceMountableVolumePlugin = &FakeVolumePlugin{}
|
||||
|
||||
func (plugin *FakeVolumePlugin) getFakeVolume(list *[]*FakeVolume) *FakeVolume {
|
||||
volume := &FakeVolume{}
|
||||
@@ -375,6 +388,10 @@ func (plugin *FakeVolumePlugin) NewAttacher() (Attacher, error) {
|
||||
return plugin.getFakeVolume(&plugin.Attachers), nil
|
||||
}
|
||||
|
||||
func (plugin *FakeVolumePlugin) NewDeviceMounter() (DeviceMounter, error) {
|
||||
return plugin.NewAttacher()
|
||||
}
|
||||
|
||||
func (plugin *FakeVolumePlugin) GetAttachers() (Attachers []*FakeVolume) {
|
||||
plugin.RLock()
|
||||
defer plugin.RUnlock()
|
||||
@@ -394,6 +411,10 @@ func (plugin *FakeVolumePlugin) NewDetacher() (Detacher, error) {
|
||||
return plugin.getFakeVolume(&plugin.Detachers), nil
|
||||
}
|
||||
|
||||
func (plugin *FakeVolumePlugin) NewDeviceUnmounter() (DeviceUnmounter, error) {
|
||||
return plugin.NewDetacher()
|
||||
}
|
||||
|
||||
func (plugin *FakeVolumePlugin) GetDetachers() (Detachers []*FakeVolume) {
|
||||
plugin.RLock()
|
||||
defer plugin.RUnlock()
|
||||
@@ -418,7 +439,7 @@ func (plugin *FakeVolumePlugin) NewProvisioner(options VolumeOptions) (Provision
|
||||
plugin.Lock()
|
||||
defer plugin.Unlock()
|
||||
plugin.LastProvisionerOptions = options
|
||||
return &FakeProvisioner{options, plugin.Host}, nil
|
||||
return &FakeProvisioner{options, plugin.Host, plugin.ProvisionDelaySeconds}, nil
|
||||
}
|
||||
|
||||
func (plugin *FakeVolumePlugin) GetAccessModes() []v1.PersistentVolumeAccessMode {
|
||||
@@ -455,6 +476,14 @@ func (plugin *FakeVolumePlugin) RequiresFSResize() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
func (plugin *FakeVolumePlugin) GetVolumeLimits() (map[string]int64, error) {
|
||||
return plugin.VolumeLimits, plugin.VolumeLimitsError
|
||||
}
|
||||
|
||||
func (plugin *FakeVolumePlugin) VolumeLimitKey(spec *Spec) string {
|
||||
return plugin.LimitKey
|
||||
}
|
||||
|
||||
type FakeFileVolumePlugin struct {
|
||||
}
|
||||
|
||||
@@ -752,8 +781,9 @@ func (fd *FakeDeleter) GetPath() string {
|
||||
}
|
||||
|
||||
type FakeProvisioner struct {
|
||||
Options VolumeOptions
|
||||
Host VolumeHost
|
||||
Options VolumeOptions
|
||||
Host VolumeHost
|
||||
ProvisionDelaySeconds int
|
||||
}
|
||||
|
||||
func (fc *FakeProvisioner) Provision(selectedNode *v1.Node, allowedTopologies []v1.TopologySelectorTerm) (*v1.PersistentVolume, error) {
|
||||
@@ -780,6 +810,10 @@ func (fc *FakeProvisioner) Provision(selectedNode *v1.Node, allowedTopologies []
|
||||
},
|
||||
}
|
||||
|
||||
if fc.ProvisionDelaySeconds > 0 {
|
||||
time.Sleep(time.Duration(fc.ProvisionDelaySeconds) * time.Second)
|
||||
}
|
||||
|
||||
return pv, nil
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user