Refactor volume interfaces to receive pod instead of ObjectReference

This commit is contained in:
Paul Morie
2015-05-10 20:12:57 -04:00
parent 738f403eea
commit cd359ffa73
21 changed files with 93 additions and 88 deletions

View File

@@ -58,7 +58,7 @@ func (plugin *hostPathPlugin) GetAccessModes() []api.AccessModeType {
}
}
func (plugin *hostPathPlugin) NewBuilder(spec *volume.Spec, podRef *api.ObjectReference, _ volume.VolumeOptions, _ mount.Interface) (volume.Builder, error) {
func (plugin *hostPathPlugin) NewBuilder(spec *volume.Spec, pod *api.Pod, _ volume.VolumeOptions, _ mount.Interface) (volume.Builder, error) {
if spec.VolumeSource.HostPath != nil {
return &hostPath{spec.VolumeSource.HostPath.Path}, nil
} else {

View File

@@ -68,7 +68,8 @@ func TestPlugin(t *testing.T) {
Name: "vol1",
VolumeSource: api.VolumeSource{HostPath: &api.HostPathVolumeSource{"/vol1"}},
}
builder, err := plug.NewBuilder(volume.NewSpecFromVolume(spec), &api.ObjectReference{UID: types.UID("poduid")}, volume.VolumeOptions{}, nil)
pod := &api.Pod{ObjectMeta: api.ObjectMeta{UID: types.UID("poduid")}}
builder, err := plug.NewBuilder(volume.NewSpecFromVolume(spec), pod, volume.VolumeOptions{}, nil)
if err != nil {
t.Errorf("Failed to make a new Builder: %v", err)
}