mirror of
https://github.com/vmware-tanzu/velero.git
synced 2026-01-03 11:45:20 +00:00
issue 8960: implement PodVolume exposer for PVB/PVR
Signed-off-by: Lyndon-Li <lyonghui@vmware.com>
This commit is contained in:
@@ -42,8 +42,8 @@ const (
|
||||
// nodeAgentRole marks pods with node-agent role on all nodes.
|
||||
nodeAgentRole = "node-agent"
|
||||
|
||||
// hostPodVolume is the name of the volume in node-agent for host-pod mount
|
||||
hostPodVolume = "host-pods"
|
||||
// HostPodVolumeMount is the name of the volume in node-agent for host-pod mount
|
||||
HostPodVolumeMount = "host-pods"
|
||||
|
||||
// HostPodVolumeMountPoint is the mount point of the volume in node-agent for host-pod mount
|
||||
HostPodVolumeMountPoint = "host_pods"
|
||||
@@ -269,7 +269,7 @@ func GetHostPodPath(ctx context.Context, kubeClient kubernetes.Interface, namesp
|
||||
|
||||
var volume *corev1api.Volume
|
||||
for _, v := range ds.Spec.Template.Spec.Volumes {
|
||||
if v.Name == hostPodVolume {
|
||||
if v.Name == HostPodVolumeMount {
|
||||
volume = &v
|
||||
break
|
||||
}
|
||||
@@ -289,3 +289,11 @@ func GetHostPodPath(ctx context.Context, kubeClient kubernetes.Interface, namesp
|
||||
|
||||
return volume.HostPath.Path, nil
|
||||
}
|
||||
|
||||
func HostPodVolumeMountPath() string {
|
||||
return "/" + HostPodVolumeMountPoint
|
||||
}
|
||||
|
||||
func HostPodVolumeMountPathWin() string {
|
||||
return "\\" + HostPodVolumeMountPoint
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user