mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-17 15:13:08 +00:00
Rename HostDir to HostPath in v1beta3
This commit is contained in:
@@ -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"},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@@ -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) {
|
||||
|
@@ -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 {
|
||||
|
Reference in New Issue
Block a user