mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-10-22 06:59:03 +00:00
implement proposal 34058: hostPath volume type
This commit is contained in:
@@ -46,6 +46,12 @@ func newStorage(t *testing.T) (*REST, *StatusREST, *etcdtesting.EtcdTestServer)
|
||||
return persistentVolumeStorage, statusStorage, server
|
||||
}
|
||||
|
||||
func newHostPathType(pathType string) *api.HostPathType {
|
||||
hostPathType := new(api.HostPathType)
|
||||
*hostPathType = api.HostPathType(pathType)
|
||||
return hostPathType
|
||||
}
|
||||
|
||||
func validNewPersistentVolume(name string) *api.PersistentVolume {
|
||||
pv := &api.PersistentVolume{
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
@@ -57,7 +63,7 @@ func validNewPersistentVolume(name string) *api.PersistentVolume {
|
||||
},
|
||||
AccessModes: []api.PersistentVolumeAccessMode{api.ReadWriteOnce},
|
||||
PersistentVolumeSource: api.PersistentVolumeSource{
|
||||
HostPath: &api.HostPathVolumeSource{Path: "/foo"},
|
||||
HostPath: &api.HostPathVolumeSource{Path: "/foo", Type: newHostPathType(string(api.HostPathDirectoryOrCreate))},
|
||||
},
|
||||
PersistentVolumeReclaimPolicy: api.PersistentVolumeReclaimRetain,
|
||||
},
|
||||
|
Reference in New Issue
Block a user