Rename HostDir to HostPath in v1beta3

This commit is contained in:
Tim Hockin
2015-01-20 15:56:44 -08:00
parent 494d003981
commit 60ec08db93
11 changed files with 105 additions and 38 deletions

View File

@@ -46,7 +46,7 @@ func ExampleManifestAndPod(id string) (api.ContainerManifest, api.BoundPod) {
{
Name: "host-dir",
Source: &api.VolumeSource{
HostDir: &api.HostDir{"/dir/path"},
HostPath: &api.HostPath{"/dir/path"},
},
},
},
@@ -68,7 +68,7 @@ func ExampleManifestAndPod(id string) (api.ContainerManifest, api.BoundPod) {
{
Name: "host-dir",
Source: &api.VolumeSource{
HostDir: &api.HostDir{"/dir/path"},
HostPath: &api.HostPath{"/dir/path"},
},
},
},

View File

@@ -46,14 +46,14 @@ func (plugin *hostPathPlugin) Name() string {
}
func (plugin *hostPathPlugin) CanSupport(spec *api.Volume) bool {
if spec.Source != nil && spec.Source.HostDir != nil {
if spec.Source != nil && spec.Source.HostPath != nil {
return true
}
return false
}
func (plugin *hostPathPlugin) NewBuilder(spec *api.Volume, podUID types.UID) (volume.Builder, error) {
return &hostPath{spec.Source.HostDir.Path}, nil
return &hostPath{spec.Source.HostPath.Path}, nil
}
func (plugin *hostPathPlugin) NewCleaner(volName string, podUID types.UID) (volume.Cleaner, error) {

View File

@@ -35,7 +35,7 @@ func TestCanSupport(t *testing.T) {
if plug.Name() != "kubernetes.io/host-path" {
t.Errorf("Wrong name: %s", plug.Name())
}
if !plug.CanSupport(&api.Volume{Source: &api.VolumeSource{HostDir: &api.HostDir{}}}) {
if !plug.CanSupport(&api.Volume{Source: &api.VolumeSource{HostPath: &api.HostPath{}}}) {
t.Errorf("Expected true")
}
if plug.CanSupport(&api.Volume{Source: nil}) {
@@ -53,7 +53,7 @@ func TestPlugin(t *testing.T) {
}
spec := &api.Volume{
Name: "vol1",
Source: &api.VolumeSource{HostDir: &api.HostDir{"/vol1"}},
Source: &api.VolumeSource{HostPath: &api.HostPath{"/vol1"}},
}
builder, err := plug.NewBuilder(spec, types.UID("poduid"))
if err != nil {