mirror of
https://github.com/NVIDIA/nvidia-container-toolkit
synced 2025-06-26 18:18:24 +00:00
Handle hook arguments for creation of symlinks
Signed-off-by: Christopher Desiniotis <cdesiniotis@nvidia.com>
This commit is contained in:
@@ -98,18 +98,54 @@ func TestRootTransformer(t *testing.T) {
|
||||
spec: &specs.Spec{
|
||||
ContainerEdits: specs.ContainerEdits{
|
||||
Hooks: []*specs.Hook{
|
||||
{Path: "/root/usr/bin/nvidia-ctk"},
|
||||
{Path: "/target-root/usr/bin/nvidia-ctk"},
|
||||
{Path: "/different-root/usr/bin/nvidia-ctk"},
|
||||
{
|
||||
Path: "/root/usr/bin/nvidia-ctk",
|
||||
Args: []string{
|
||||
"--link",
|
||||
"/root/path/to/target::/root/path/to/link",
|
||||
},
|
||||
},
|
||||
{
|
||||
Path: "/target-root/usr/bin/nvidia-ctk",
|
||||
Args: []string{
|
||||
"--link",
|
||||
"/target-root/path/to/target::/target-root/path/to/link",
|
||||
},
|
||||
},
|
||||
{
|
||||
Path: "/different-root/usr/bin/nvidia-ctk",
|
||||
Args: []string{
|
||||
"--link",
|
||||
"/different-root/path/to/target::/different-root/path/to/link",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
expectedSpec: &specs.Spec{
|
||||
ContainerEdits: specs.ContainerEdits{
|
||||
Hooks: []*specs.Hook{
|
||||
{Path: "/target-root/usr/bin/nvidia-ctk"},
|
||||
{Path: "/target-root/usr/bin/nvidia-ctk"},
|
||||
{Path: "/different-root/usr/bin/nvidia-ctk"},
|
||||
{
|
||||
Path: "/target-root/usr/bin/nvidia-ctk",
|
||||
Args: []string{
|
||||
"--link",
|
||||
"/target-root/path/to/target::/target-root/path/to/link",
|
||||
},
|
||||
},
|
||||
{
|
||||
Path: "/target-root/usr/bin/nvidia-ctk",
|
||||
Args: []string{
|
||||
"--link",
|
||||
"/target-root/path/to/target::/target-root/path/to/link",
|
||||
},
|
||||
},
|
||||
{
|
||||
Path: "/different-root/usr/bin/nvidia-ctk",
|
||||
Args: []string{
|
||||
"--link",
|
||||
"/different-root/path/to/target::/different-root/path/to/link",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user