integration: Simplify WithVolumeMount()

Signed-off-by: Rodrigo Campos <rodrigoca@microsoft.com>
This commit is contained in:
Rodrigo Campos 2023-07-21 13:31:33 +02:00
parent 24aa808fe2
commit e832605a80

View File

@ -286,16 +286,7 @@ func WithWindowsResources(r *runtime.WindowsContainerResources) ContainerOpts {
}
func WithVolumeMount(hostPath, containerPath string) ContainerOpts {
return func(c *runtime.ContainerConfig) {
hostPath, _ = filepath.Abs(hostPath)
containerPath, _ = filepath.Abs(containerPath)
mount := &runtime.Mount{
HostPath: hostPath,
ContainerPath: containerPath,
SelinuxRelabel: selinux.GetEnabled(),
}
c.Mounts = append(c.Mounts, mount)
}
return WithIDMapVolumeMount(hostPath, containerPath, nil, nil)
}
func WithIDMapVolumeMount(hostPath, containerPath string, uidMaps, gidMaps []*runtime.IDMapping) ContainerOpts {