Skip to content

Commit

Permalink
Add ConvertVolumeSource function to storage module
Browse files Browse the repository at this point in the history
Converts from VolumeSource to a corev1.VolumeSource
  • Loading branch information
dprince committed Oct 16, 2024
1 parent 7eba2eb commit e89d57e
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions modules/storage/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,3 +151,25 @@ func (v *VolMounts) Propagate(svc []PropagationType) []VolMounts {

return vl
}

// ConvertVolumeSource function to convert from a VolumeSource to a corev1.VolumeSource
func ConvertVolumeSource(v *VolumeSource) corev1.VolumeSource {
return corev1.VolumeSource{
HostPath: v.HostPath,
EmptyDir: v.EmptyDir,
Secret: v.Secret,
NFS: v.NFS,
ISCSI: v.ISCSI,
PersistentVolumeClaim: v.PersistentVolumeClaim,
CephFS: v.CephFS,
DownwardAPI: v.DownwardAPI,
FC: v.FC,
ConfigMap: v.ConfigMap,
PhotonPersistentDisk: v.PhotonPersistentDisk,
Projected: v.Projected,
ScaleIO: v.ScaleIO,
StorageOS: v.StorageOS,
CSI: v.CSI,
Ephemeral: v.Ephemeral,
}
}

0 comments on commit e89d57e

Please sign in to comment.