Skip to content

Commit 0101bff

Browse files
committed
[state-toolkit] add support for mounting runtime NRI sockets
Signed-off-by: Tariq Ibrahim <[email protected]>
1 parent 239d2f2 commit 0101bff

File tree

2 files changed

+65
-6
lines changed

2 files changed

+65
-6
lines changed

controllers/object_controls.go

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@ const (
6666
DefaultDockerConfigFile = "/etc/docker/daemon.json"
6767
// DefaultDockerSocketFile indicates default docker socket file
6868
DefaultDockerSocketFile = "/var/run/docker.sock"
69+
// DefaultRuntimeNRISocketFile indicates the default container runtime NRI socket file
70+
DefaultRuntimeNRISocketFile = "/var/run/nri/nri.sock"
6971
// DefaultCRIOConfigFile indicates default config file path for cri-o. .
7072
DefaultCRIOConfigFile = "/etc/crio/config.toml"
7173
// DefaultCRIODropInConfigFile indicates the default path to the drop-in config file for cri-o
@@ -82,9 +84,11 @@ const (
8284
DefaultRuntimeClass = "nvidia"
8385
// DriverInstallPathVolName represents volume name for driver install path provided to toolkit
8486
DriverInstallPathVolName = "driver-install-path"
85-
// DefaultRuntimeSocketTargetDir represents target directory where runtime socket dirctory will be mounted
87+
// DefaultRuntimeNRISocketTargetDir represents target directory where runtime NRI socket directory will be mounted
88+
DefaultRuntimeNRISocketTargetDir = "/runtime/nri-sock-dir/"
89+
// DefaultRuntimeSocketTargetDir represents target directory where runtime socket directory will be mounted
8690
DefaultRuntimeSocketTargetDir = "/runtime/sock-dir/"
87-
// DefaultRuntimeConfigTargetDir represents target directory where runtime socket dirctory will be mounted
91+
// DefaultRuntimeConfigTargetDir represents target directory where runtime socket directory will be mounted
8892
DefaultRuntimeConfigTargetDir = "/runtime/config-dir/"
8993
// DefaultRuntimeDropInConfigTargetDir represents target directory where drop-in config directory will be mounted
9094
DefaultRuntimeDropInConfigTargetDir = "/runtime/config-dir.d/"
@@ -1440,6 +1444,22 @@ func transformForRuntime(obj *appsv1.DaemonSet, config *gpuv1.ClusterPolicySpec,
14401444
socketVol := corev1.Volume{Name: volMountSocketName, VolumeSource: corev1.VolumeSource{HostPath: &corev1.HostPathVolumeSource{Path: path.Dir(runtimeSocketFile)}}}
14411445
obj.Spec.Template.Spec.Volumes = append(obj.Spec.Template.Spec.Volumes, socketVol)
14421446
}
1447+
1448+
// setup mounts for the runtime NRI socket file
1449+
nriSocketFile := getContainerEnv(container, "RUNTIME_NRI_SOCKET")
1450+
if nriSocketFile == "" {
1451+
nriSocketFile = DefaultRuntimeNRISocketFile
1452+
}
1453+
1454+
setContainerEnv(container, "RUNTIME_NRI_SOCKET", DefaultRuntimeNRISocketTargetDir+path.Base(nriSocketFile))
1455+
1456+
nriVolMountSocketName := "nri-socket"
1457+
nriVolMountSocket := corev1.VolumeMount{Name: nriVolMountSocketName, MountPath: DefaultRuntimeNRISocketTargetDir}
1458+
container.VolumeMounts = append(container.VolumeMounts, nriVolMountSocket)
1459+
1460+
nriSocketVol := corev1.Volume{Name: nriVolMountSocketName, VolumeSource: corev1.VolumeSource{HostPath: &corev1.HostPathVolumeSource{Path: path.Dir(nriSocketFile), Type: ptr.To(corev1.HostPathDirectoryOrCreate)}}}
1461+
obj.Spec.Template.Spec.Volumes = append(obj.Spec.Template.Spec.Volumes, nriSocketVol)
1462+
14431463
return nil
14441464
}
14451465

controllers/transforms_test.go

Lines changed: 43 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,7 @@ func TestTransformForRuntime(t *testing.T) {
381381
WithHostPathVolume("containerd-config", filepath.Dir(DefaultContainerdConfigFile), ptr.To(corev1.HostPathDirectoryOrCreate)).
382382
WithHostPathVolume("containerd-drop-in-config", "/etc/containerd/conf.d", ptr.To(corev1.HostPathDirectoryOrCreate)).
383383
WithHostPathVolume("containerd-socket", filepath.Dir(DefaultContainerdSocketFile), nil).
384+
WithHostPathVolume("nri-socket", filepath.Dir(DefaultRuntimeNRISocketFile), ptr.To(corev1.HostPathDirectoryOrCreate)).
384385
WithContainer(corev1.Container{
385386
Name: "test-ctr",
386387
Env: []corev1.EnvVar{
@@ -392,11 +393,13 @@ func TestTransformForRuntime(t *testing.T) {
392393
{Name: "RUNTIME_DROP_IN_CONFIG_HOST_PATH", Value: "/etc/containerd/conf.d/99-nvidia.toml"},
393394
{Name: "RUNTIME_SOCKET", Value: filepath.Join(DefaultRuntimeSocketTargetDir, filepath.Base(DefaultContainerdSocketFile))},
394395
{Name: "CONTAINERD_SOCKET", Value: filepath.Join(DefaultRuntimeSocketTargetDir, filepath.Base(DefaultContainerdSocketFile))},
396+
{Name: "RUNTIME_NRI_SOCKET", Value: filepath.Join(DefaultRuntimeNRISocketTargetDir, filepath.Base(DefaultRuntimeNRISocketFile))},
395397
},
396398
VolumeMounts: []corev1.VolumeMount{
397399
{Name: "containerd-config", MountPath: DefaultRuntimeConfigTargetDir},
398400
{Name: "containerd-drop-in-config", MountPath: "/runtime/config-dir.d/"},
399401
{Name: "containerd-socket", MountPath: DefaultRuntimeSocketTargetDir},
402+
{Name: "nri-socket", MountPath: DefaultRuntimeNRISocketTargetDir},
400403
},
401404
}),
402405
},
@@ -414,6 +417,7 @@ func TestTransformForRuntime(t *testing.T) {
414417
WithHostPathVolume("containerd-config", filepath.Dir(DefaultContainerdConfigFile), ptr.To(corev1.HostPathDirectoryOrCreate)).
415418
WithHostPathVolume("containerd-drop-in-config", "/etc/containerd/conf.d", ptr.To(corev1.HostPathDirectoryOrCreate)).
416419
WithHostPathVolume("containerd-socket", filepath.Dir(DefaultContainerdSocketFile), nil).
420+
WithHostPathVolume("nri-socket", filepath.Dir(DefaultRuntimeNRISocketFile), ptr.To(corev1.HostPathDirectoryOrCreate)).
417421
WithContainer(corev1.Container{
418422
Name: "test-ctr",
419423
Env: []corev1.EnvVar{
@@ -426,11 +430,13 @@ func TestTransformForRuntime(t *testing.T) {
426430
{Name: "RUNTIME_DROP_IN_CONFIG_HOST_PATH", Value: "/etc/containerd/conf.d/99-nvidia.toml"},
427431
{Name: "RUNTIME_SOCKET", Value: filepath.Join(DefaultRuntimeSocketTargetDir, filepath.Base(DefaultContainerdSocketFile))},
428432
{Name: "CONTAINERD_SOCKET", Value: filepath.Join(DefaultRuntimeSocketTargetDir, filepath.Base(DefaultContainerdSocketFile))},
433+
{Name: "RUNTIME_NRI_SOCKET", Value: filepath.Join(DefaultRuntimeNRISocketTargetDir, filepath.Base(DefaultRuntimeNRISocketFile))},
429434
},
430435
VolumeMounts: []corev1.VolumeMount{
431436
{Name: "containerd-config", MountPath: DefaultRuntimeConfigTargetDir},
432437
{Name: "containerd-drop-in-config", MountPath: "/runtime/config-dir.d/"},
433438
{Name: "containerd-socket", MountPath: DefaultRuntimeSocketTargetDir},
439+
{Name: "nri-socket", MountPath: DefaultRuntimeNRISocketTargetDir},
434440
},
435441
}),
436442
},
@@ -448,6 +454,7 @@ func TestTransformForRuntime(t *testing.T) {
448454
WithHostPathVolume("containerd-config", filepath.Dir(DefaultContainerdConfigFile), ptr.To(corev1.HostPathDirectoryOrCreate)).
449455
WithHostPathVolume("containerd-drop-in-config", "/etc/containerd/conf.d", ptr.To(corev1.HostPathDirectoryOrCreate)).
450456
WithHostPathVolume("containerd-socket", filepath.Dir(DefaultContainerdSocketFile), nil).
457+
WithHostPathVolume("nri-socket", filepath.Dir(DefaultRuntimeNRISocketFile), ptr.To(corev1.HostPathDirectoryOrCreate)).
451458
WithContainer(corev1.Container{
452459
Name: "test-ctr",
453460
Env: []corev1.EnvVar{
@@ -460,11 +467,13 @@ func TestTransformForRuntime(t *testing.T) {
460467
{Name: "RUNTIME_DROP_IN_CONFIG_HOST_PATH", Value: "/etc/containerd/conf.d/99-nvidia.toml"},
461468
{Name: "RUNTIME_SOCKET", Value: filepath.Join(DefaultRuntimeSocketTargetDir, filepath.Base(DefaultContainerdSocketFile))},
462469
{Name: "CONTAINERD_SOCKET", Value: filepath.Join(DefaultRuntimeSocketTargetDir, filepath.Base(DefaultContainerdSocketFile))},
470+
{Name: "RUNTIME_NRI_SOCKET", Value: filepath.Join(DefaultRuntimeNRISocketTargetDir, filepath.Base(DefaultRuntimeNRISocketFile))},
463471
},
464472
VolumeMounts: []corev1.VolumeMount{
465473
{Name: "containerd-config", MountPath: DefaultRuntimeConfigTargetDir},
466474
{Name: "containerd-drop-in-config", MountPath: "/runtime/config-dir.d/"},
467475
{Name: "containerd-socket", MountPath: DefaultRuntimeSocketTargetDir},
476+
{Name: "nri-socket", MountPath: DefaultRuntimeNRISocketTargetDir},
468477
},
469478
}),
470479
},
@@ -475,6 +484,7 @@ func TestTransformForRuntime(t *testing.T) {
475484
expectedOutput: NewDaemonset().
476485
WithHostPathVolume("crio-config", "/etc/crio", ptr.To(corev1.HostPathDirectoryOrCreate)).
477486
WithHostPathVolume("crio-drop-in-config", "/etc/crio/crio.conf.d", ptr.To(corev1.HostPathDirectoryOrCreate)).
487+
WithHostPathVolume("nri-socket", filepath.Dir(DefaultRuntimeNRISocketFile), ptr.To(corev1.HostPathDirectoryOrCreate)).
478488
WithContainer(corev1.Container{
479489
Name: "test-ctr",
480490
Env: []corev1.EnvVar{
@@ -483,10 +493,12 @@ func TestTransformForRuntime(t *testing.T) {
483493
{Name: "CRIO_CONFIG", Value: "/runtime/config-dir/config.toml"},
484494
{Name: "RUNTIME_DROP_IN_CONFIG", Value: "/runtime/config-dir.d/99-nvidia.conf"},
485495
{Name: "RUNTIME_DROP_IN_CONFIG_HOST_PATH", Value: "/etc/crio/crio.conf.d/99-nvidia.conf"},
496+
{Name: "RUNTIME_NRI_SOCKET", Value: filepath.Join(DefaultRuntimeNRISocketTargetDir, filepath.Base(DefaultRuntimeNRISocketFile))},
486497
},
487498
VolumeMounts: []corev1.VolumeMount{
488499
{Name: "crio-config", MountPath: DefaultRuntimeConfigTargetDir},
489500
{Name: "crio-drop-in-config", MountPath: "/runtime/config-dir.d/"},
501+
{Name: "nri-socket", MountPath: DefaultRuntimeNRISocketTargetDir},
490502
},
491503
}),
492504
},
@@ -499,6 +511,7 @@ func TestTransformForRuntime(t *testing.T) {
499511
expectedOutput: NewDaemonset().
500512
WithHostPathVolume("containerd-config", filepath.Dir(DefaultContainerdConfigFile), ptr.To(corev1.HostPathDirectoryOrCreate)).
501513
WithHostPathVolume("containerd-socket", filepath.Dir(DefaultContainerdSocketFile), nil).
514+
WithHostPathVolume("nri-socket", filepath.Dir(DefaultRuntimeNRISocketFile), ptr.To(corev1.HostPathDirectoryOrCreate)).
502515
WithContainer(corev1.Container{
503516
Name: "nvidia-kata-manager",
504517
Env: []corev1.EnvVar{
@@ -508,10 +521,12 @@ func TestTransformForRuntime(t *testing.T) {
508521
{Name: "CONTAINERD_CONFIG", Value: filepath.Join(DefaultRuntimeConfigTargetDir, filepath.Base(DefaultContainerdConfigFile))},
509522
{Name: "RUNTIME_SOCKET", Value: filepath.Join(DefaultRuntimeSocketTargetDir, filepath.Base(DefaultContainerdSocketFile))},
510523
{Name: "CONTAINERD_SOCKET", Value: filepath.Join(DefaultRuntimeSocketTargetDir, filepath.Base(DefaultContainerdSocketFile))},
524+
{Name: "RUNTIME_NRI_SOCKET", Value: filepath.Join(DefaultRuntimeNRISocketTargetDir, filepath.Base(DefaultRuntimeNRISocketFile))},
511525
},
512526
VolumeMounts: []corev1.VolumeMount{
513527
{Name: "containerd-config", MountPath: DefaultRuntimeConfigTargetDir},
514528
{Name: "containerd-socket", MountPath: DefaultRuntimeSocketTargetDir},
529+
{Name: "nri-socket", MountPath: DefaultRuntimeNRISocketTargetDir},
515530
},
516531
}),
517532
},
@@ -522,6 +537,7 @@ func TestTransformForRuntime(t *testing.T) {
522537
expectedOutput: NewDaemonset().
523538
WithHostPathVolume("docker-config", filepath.Dir(DefaultDockerConfigFile), ptr.To(corev1.HostPathDirectoryOrCreate)).
524539
WithHostPathVolume("docker-socket", filepath.Dir(DefaultDockerSocketFile), nil).
540+
WithHostPathVolume("nri-socket", filepath.Dir(DefaultRuntimeNRISocketFile), ptr.To(corev1.HostPathDirectoryOrCreate)).
525541
WithContainer(corev1.Container{
526542
Name: "test-ctr",
527543
Env: []corev1.EnvVar{
@@ -530,10 +546,12 @@ func TestTransformForRuntime(t *testing.T) {
530546
{Name: "DOCKER_CONFIG", Value: filepath.Join(DefaultRuntimeConfigTargetDir, filepath.Base(DefaultDockerConfigFile))},
531547
{Name: "RUNTIME_SOCKET", Value: filepath.Join(DefaultRuntimeSocketTargetDir, filepath.Base(DefaultDockerSocketFile))},
532548
{Name: "DOCKER_SOCKET", Value: filepath.Join(DefaultRuntimeSocketTargetDir, filepath.Base(DefaultDockerSocketFile))},
549+
{Name: "RUNTIME_NRI_SOCKET", Value: filepath.Join(DefaultRuntimeNRISocketTargetDir, filepath.Base(DefaultRuntimeNRISocketFile))},
533550
},
534551
VolumeMounts: []corev1.VolumeMount{
535552
{Name: "docker-config", MountPath: DefaultRuntimeConfigTargetDir},
536553
{Name: "docker-socket", MountPath: DefaultRuntimeSocketTargetDir},
554+
{Name: "nri-socket", MountPath: DefaultRuntimeNRISocketTargetDir},
537555
},
538556
}),
539557
},
@@ -834,16 +852,19 @@ func TestTransformToolkit(t *testing.T) {
834852
{Name: "RUNTIME_DROP_IN_CONFIG_HOST_PATH", Value: "/etc/containerd/conf.d/99-nvidia.toml"},
835853
{Name: "RUNTIME_SOCKET", Value: "/runtime/sock-dir/containerd.sock"},
836854
{Name: "CONTAINERD_SOCKET", Value: "/runtime/sock-dir/containerd.sock"},
855+
{Name: "RUNTIME_NRI_SOCKET", Value: "/runtime/nri-sock-dir/nri.sock"},
837856
},
838857
VolumeMounts: []corev1.VolumeMount{
839858
{Name: "containerd-config", MountPath: "/runtime/config-dir/"},
840859
{Name: "containerd-drop-in-config", MountPath: "/runtime/config-dir.d/"},
841860
{Name: "containerd-socket", MountPath: "/runtime/sock-dir/"},
861+
{Name: "nri-socket", MountPath: "/runtime/nri-sock-dir/"},
842862
},
843863
}).
844864
WithHostPathVolume("containerd-config", "/etc/containerd", ptr.To(corev1.HostPathDirectoryOrCreate)).
845865
WithHostPathVolume("containerd-drop-in-config", "/etc/containerd/conf.d", ptr.To(corev1.HostPathDirectoryOrCreate)).
846866
WithHostPathVolume("containerd-socket", "/run/containerd", nil).
867+
WithHostPathVolume("nri-socket", "/var/run/nri", ptr.To(corev1.HostPathDirectoryOrCreate)).
847868
WithPullSecret("pull-secret"),
848869
},
849870
{
@@ -913,16 +934,19 @@ func TestTransformToolkit(t *testing.T) {
913934
{Name: "RUNTIME_DROP_IN_CONFIG", Value: "/runtime/config-dir.d/99-nvidia.toml"},
914935
{Name: "RUNTIME_DROP_IN_CONFIG_HOST_PATH", Value: "/etc/containerd/conf.d/99-nvidia.toml"},
915936
{Name: "RUNTIME_SOCKET", Value: "/runtime/sock-dir/containerd.sock"},
937+
{Name: "RUNTIME_NRI_SOCKET", Value: "/runtime/nri-sock-dir/nri.sock"},
916938
},
917939
VolumeMounts: []corev1.VolumeMount{
918940
{Name: "containerd-config", MountPath: "/runtime/config-dir/"},
919941
{Name: "containerd-drop-in-config", MountPath: "/runtime/config-dir.d/"},
920942
{Name: "containerd-socket", MountPath: "/runtime/sock-dir/"},
943+
{Name: "nri-socket", MountPath: "/runtime/nri-sock-dir/"},
921944
},
922945
}).
923946
WithHostPathVolume("containerd-config", "/var/lib/rancher/k3s/agent/etc/containerd", ptr.To(corev1.HostPathDirectoryOrCreate)).
924947
WithHostPathVolume("containerd-drop-in-config", "/etc/containerd/conf.d", ptr.To(corev1.HostPathDirectoryOrCreate)).
925948
WithHostPathVolume("containerd-socket", "/run/k3s/containerd", nil).
949+
WithHostPathVolume("nri-socket", "/var/run/nri", ptr.To(corev1.HostPathDirectoryOrCreate)).
926950
WithPullSecret("pull-secret"),
927951
},
928952
{
@@ -952,14 +976,17 @@ func TestTransformToolkit(t *testing.T) {
952976
{Name: "CRIO_CONFIG", Value: "/runtime/config-dir/config.toml"},
953977
{Name: "RUNTIME_DROP_IN_CONFIG", Value: "/runtime/config-dir.d/99-nvidia.conf"},
954978
{Name: "RUNTIME_DROP_IN_CONFIG_HOST_PATH", Value: "/etc/crio/crio.conf.d/99-nvidia.conf"},
979+
{Name: "RUNTIME_NRI_SOCKET", Value: "/runtime/nri-sock-dir/nri.sock"},
955980
},
956981
VolumeMounts: []corev1.VolumeMount{
957982
{Name: "crio-config", MountPath: DefaultRuntimeConfigTargetDir},
958983
{Name: "crio-drop-in-config", MountPath: "/runtime/config-dir.d/"},
984+
{Name: "nri-socket", MountPath: "/runtime/nri-sock-dir/"},
959985
},
960986
}).
961987
WithHostPathVolume("crio-config", "/etc/crio", ptr.To(corev1.HostPathDirectoryOrCreate)).
962-
WithHostPathVolume("crio-drop-in-config", "/etc/crio/crio.conf.d", ptr.To(corev1.HostPathDirectoryOrCreate)),
988+
WithHostPathVolume("crio-drop-in-config", "/etc/crio/crio.conf.d", ptr.To(corev1.HostPathDirectoryOrCreate)).
989+
WithHostPathVolume("nri-socket", "/var/run/nri", ptr.To(corev1.HostPathDirectoryOrCreate)),
963990
},
964991
{
965992
description: "transform nvidia-container-toolkit-ctr container, cri-o runtime, cdi disabled",
@@ -988,14 +1015,17 @@ func TestTransformToolkit(t *testing.T) {
9881015
{Name: "CRIO_CONFIG", Value: "/runtime/config-dir/config.toml"},
9891016
{Name: "RUNTIME_DROP_IN_CONFIG", Value: "/runtime/config-dir.d/99-nvidia.conf"},
9901017
{Name: "RUNTIME_DROP_IN_CONFIG_HOST_PATH", Value: "/etc/crio/crio.conf.d/99-nvidia.conf"},
1018+
{Name: "RUNTIME_NRI_SOCKET", Value: "/runtime/nri-sock-dir/nri.sock"},
9911019
},
9921020
VolumeMounts: []corev1.VolumeMount{
9931021
{Name: "crio-config", MountPath: DefaultRuntimeConfigTargetDir},
9941022
{Name: "crio-drop-in-config", MountPath: "/runtime/config-dir.d/"},
1023+
{Name: "nri-socket", MountPath: "/runtime/nri-sock-dir/"},
9951024
},
9961025
}).
9971026
WithHostPathVolume("crio-config", "/etc/crio", ptr.To(corev1.HostPathDirectoryOrCreate)).
998-
WithHostPathVolume("crio-drop-in-config", "/etc/crio/crio.conf.d", ptr.To(corev1.HostPathDirectoryOrCreate)),
1027+
WithHostPathVolume("crio-drop-in-config", "/etc/crio/crio.conf.d", ptr.To(corev1.HostPathDirectoryOrCreate)).
1028+
WithHostPathVolume("nri-socket", "/var/run/nri", ptr.To(corev1.HostPathDirectoryOrCreate)),
9991029
},
10001030
}
10011031

@@ -1578,13 +1608,19 @@ func TestTransformKataManager(t *testing.T) {
15781608
{Name: "CONTAINERD_CONFIG", Value: "/runtime/config-dir/config.toml"},
15791609
{Name: "RUNTIME_SOCKET", Value: "/runtime/sock-dir/containerd.sock"},
15801610
{Name: "CONTAINERD_SOCKET", Value: "/runtime/sock-dir/containerd.sock"},
1611+
{Name: "RUNTIME_NRI_SOCKET", Value: "/runtime/nri-sock-dir/nri.sock"},
15811612
},
15821613
VolumeMounts: []corev1.VolumeMount{
15831614
{Name: "kata-artifacts", MountPath: "/var/lib/kata"},
15841615
{Name: "containerd-config", MountPath: "/runtime/config-dir/"},
15851616
{Name: "containerd-socket", MountPath: "/runtime/sock-dir/"},
1617+
{Name: "nri-socket", MountPath: "/runtime/nri-sock-dir/"},
15861618
},
1587-
}).WithPullSecret("pull-secret").WithPodAnnotations(map[string]string{"nvidia.com/kata-manager.last-applied-hash": "1929911998"}).WithHostPathVolume("kata-artifacts", "/var/lib/kata", ptr.To(corev1.HostPathDirectoryOrCreate)).WithHostPathVolume("containerd-config", "/etc/containerd", ptr.To(corev1.HostPathDirectoryOrCreate)).WithHostPathVolume("containerd-socket", "/run/containerd", nil),
1619+
}).WithPullSecret("pull-secret").WithPodAnnotations(map[string]string{"nvidia.com/kata-manager.last-applied-hash": "1929911998"}).
1620+
WithHostPathVolume("kata-artifacts", "/var/lib/kata", ptr.To(corev1.HostPathDirectoryOrCreate)).
1621+
WithHostPathVolume("containerd-config", "/etc/containerd", ptr.To(corev1.HostPathDirectoryOrCreate)).
1622+
WithHostPathVolume("containerd-socket", "/run/containerd", nil).
1623+
WithHostPathVolume("nri-socket", "/var/run/nri", ptr.To(corev1.HostPathDirectoryOrCreate)),
15881624
},
15891625
{
15901626
description: "transform kata manager with custom container runtime socket",
@@ -1630,17 +1666,20 @@ func TestTransformKataManager(t *testing.T) {
16301666
{Name: "RUNTIME", Value: "containerd"},
16311667
{Name: "RUNTIME_CONFIG", Value: "/runtime/config-dir/config.toml"},
16321668
{Name: "RUNTIME_SOCKET", Value: "/runtime/sock-dir/containerd.sock"},
1669+
{Name: "RUNTIME_NRI_SOCKET", Value: "/runtime/nri-sock-dir/nri.sock"},
16331670
},
16341671
VolumeMounts: []corev1.VolumeMount{
16351672
{Name: "kata-artifacts", MountPath: "/var/lib/kata"},
16361673
{Name: "containerd-config", MountPath: "/runtime/config-dir/"},
16371674
{Name: "containerd-socket", MountPath: "/runtime/sock-dir/"},
1675+
{Name: "nri-socket", MountPath: "/runtime/nri-sock-dir/"},
16381676
},
16391677
}).WithPullSecret("pull-secret").
16401678
WithPodAnnotations(map[string]string{"nvidia.com/kata-manager.last-applied-hash": "1929911998"}).
16411679
WithHostPathVolume("kata-artifacts", "/var/lib/kata", ptr.To(corev1.HostPathDirectoryOrCreate)).
16421680
WithHostPathVolume("containerd-config", "/var/lib/rancher/k3s/agent/etc/containerd", ptr.To(corev1.HostPathDirectoryOrCreate)).
1643-
WithHostPathVolume("containerd-socket", "/run/k3s/containerd", nil),
1681+
WithHostPathVolume("containerd-socket", "/run/k3s/containerd", nil).
1682+
WithHostPathVolume("nri-socket", "/var/run/nri", ptr.To(corev1.HostPathDirectoryOrCreate)),
16441683
},
16451684
}
16461685

0 commit comments

Comments
 (0)