Merge pull request #46395 from mindprince/issue-46204-45803-kubelet-volumes-test-flake

Automatic merge from submit-queue (batch tested with PRs 46429, 46308, 46395, 45867, 45492)

Implement FakeVolumePlugin's ConstructVolumeSpec method according to interface expectation.

This fixes #45803 and #46204.

**Release note**:
```release-note
NONE
```
This commit is contained in:
Kubernetes Submit Queue 2017-05-25 22:42:06 -07:00 committed by GitHub
commit 07038c9417
3 changed files with 7 additions and 1 deletions

View File

@ -112,6 +112,7 @@ func TestParseResolvConf(t *testing.T) {
func TestComposeDNSSearch(t *testing.T) {
testKubelet := newTestKubelet(t, false /* controllerAttachDetachEnabled */)
defer testKubelet.Cleanup()
kubelet := testKubelet.kubelet
recorder := record.NewFakeRecorder(20)

View File

@ -33,6 +33,7 @@ import (
func TestListVolumesForPod(t *testing.T) {
testKubelet := newTestKubelet(t, false /* controllerAttachDetachEnabled */)
defer testKubelet.Cleanup()
kubelet := testKubelet.kubelet
pod := podWithUidNameNsSpec("12345678", "foo", "test", v1.PodSpec{

View File

@ -303,7 +303,11 @@ func (plugin *FakeVolumePlugin) GetAccessModes() []v1.PersistentVolumeAccessMode
}
func (plugin *FakeVolumePlugin) ConstructVolumeSpec(volumeName, mountPath string) (*Spec, error) {
return nil, nil
return &Spec{
Volume: &v1.Volume{
Name: volumeName,
},
}, nil
}
func (plugin *FakeVolumePlugin) GetDeviceMountRefs(deviceMountPath string) ([]string, error) {