diff --git a/pkg/api/types.go b/pkg/api/types.go index 6b62d4e8608..2d4fc187d75 100644 --- a/pkg/api/types.go +++ b/pkg/api/types.go @@ -195,20 +195,6 @@ type VolumeSource struct { NFS *NFSVolumeSource `json:"nfs"` } -// PersistentVolumeSource is similar to VolumeSource but meant for the administrator who creates PVs. -// Exactly one of its members must be set. -type PersistentVolumeSource struct { - // GCEPersistentDisk represents a GCE Disk resource that is attached to a - // kubelet's host machine and then exposed to the pod. - GCEPersistentDisk *GCEPersistentDiskVolumeSource `json:"persistentDisk"` - // HostPath represents a directory on the host. - // This is useful for development and testing only. - // on-host storage is not supported in any way - HostPath *HostPathVolumeSource `json:"hostPath"` - // NFS represents an NFS mount on the host that shares a pod's lifetime - NFS *NFSVolumeSource `json:"nfs"` -} - // used by VolumeSources to describe their mounting/access modes type AccessModeType string diff --git a/pkg/api/v1beta1/types.go b/pkg/api/v1beta1/types.go index 268c311b274..36893f31572 100644 --- a/pkg/api/v1beta1/types.go +++ b/pkg/api/v1beta1/types.go @@ -109,20 +109,6 @@ type VolumeSource struct { NFS *NFSVolumeSource `json:"nfs" description:"NFS volume that will be mounted in the host machine "` } -// PersistentVolumeSource is similar to VolumeSource but meant for the administrator who creates PVs. -// Exactly one of its members must be set. -type PersistentVolumeSource struct { - // GCEPersistentDisk represents a GCE Disk resource that is attached to a - // kubelet's host machine and then exposed to the pod. - GCEPersistentDisk *GCEPersistentDiskVolumeSource `json:"persistentDisk" description:"GCE disk resource attached to the host machine on demand"` - // HostPath represents a directory on the host. - // This is useful for development and testing only. - // on-host storage is not supported in any way - HostPath *HostPathVolumeSource `json:"hostPath" description:"Persistent hostPath volume useful for development and testing"` - // NFS represents an NFS mount on the host that shares a pod's lifetime - NFS *NFSVolumeSource `json:"nfs" description:"Persistent NFS volume that will be mounted in the host machine"` -} - // used by VolumeSources to describe their mounting/access modes type AccessModeType string diff --git a/pkg/api/v1beta2/types.go b/pkg/api/v1beta2/types.go index 68baea9dac8..245902137fb 100644 --- a/pkg/api/v1beta2/types.go +++ b/pkg/api/v1beta2/types.go @@ -82,20 +82,6 @@ type VolumeSource struct { NFS *NFSVolumeSource `json:"nfs" description:"NFS volume that will be mounted in the host machine"` } -// PersistentVolumeSource is similar to VolumeSource but meant for the administrator who creates PVs. -// Exactly one of its members must be set. -type PersistentVolumeSource struct { - // GCEPersistentDisk represents a GCE Disk resource that is attached to a - // kubelet's host machine and then exposed to the pod. - GCEPersistentDisk *GCEPersistentDiskVolumeSource `json:"persistentDisk" description:"GCE disk resource attached to the host machine on demand"` - // HostPath represents a directory on the host. - // This is useful for development and testing only. - // on-host storage is not supported in any way - HostPath *HostPathVolumeSource `json:"hostPath" description:"Persistent hostPath volume useful for development and testing"` - // NFS represents an NFS mount on the host that shares a pod's lifetime - NFS *NFSVolumeSource `json:"nfs" description:"Persistent NFS volume that will be mounted in the host machine"` -} - // used by VolumeSources to describe their mounting/access modes type AccessModeType string diff --git a/pkg/api/v1beta3/types.go b/pkg/api/v1beta3/types.go index 0c084374e27..a277497dc6d 100644 --- a/pkg/api/v1beta3/types.go +++ b/pkg/api/v1beta3/types.go @@ -214,20 +214,6 @@ type VolumeSource struct { NFS *NFSVolumeSource `json:"nfs" description:"NFS volume that will be mounted in the host machine"` } -// PersistentVolumeSource is similar to VolumeSource but meant for the administrator who creates PVs. -// Exactly one of its members must be set. -type PersistentVolumeSource struct { - // GCEPersistentDisk represents a GCE Disk resource that is attached to a - // kubelet's host machine and then exposed to the pod. - GCEPersistentDisk *GCEPersistentDiskVolumeSource `json:"persistentDisk" description:"GCE disk resource attached to the host machine on demand"` - // HostPath represents a directory on the host. - // This is useful for development and testing only. - // on-host storage is not supported in any way - HostPath *HostPathVolumeSource `json:"hostPath" description:"Persistent hostPath volume useful for development and testing"` - // NFS represents an NFS mount on the host that shares a pod's lifetime - NFS *NFSVolumeSource `json:"nfs" description:"Persistent NFS volume that will be mounted in the host machine"` -} - // used by VolumeSources to describe their mounting/access modes type AccessModeType string diff --git a/pkg/volume/plugins.go b/pkg/volume/plugins.go index f11289a20b2..9d80a9f3d4b 100644 --- a/pkg/volume/plugins.go +++ b/pkg/volume/plugins.go @@ -182,17 +182,6 @@ func (pm *VolumePluginMgr) FindPluginByName(name string) (VolumePlugin, error) { return pm.plugins[matches[0]], nil } -// FindPersistentPluginBySpec looks for a plugin that can support a given volume -// specification. If no plugins can support or more than one plugin can -// support it, return error. -func (pm *VolumePluginMgr) FindPersistentPluginBySpec(spec *api.Volume) (PersistentVolumePlugin, error) { - volumePlugin, err := pm.FindPluginBySpec(spec) - if err != nil { - return nil, err - } - return volumePlugin.(PersistentVolumePlugin), nil -} - // FindPluginByName fetches a plugin by name or by legacy name. If no plugin // is found, returns error. func (pm *VolumePluginMgr) FindPersistentPluginByName(name string) (PersistentVolumePlugin, error) {