MCPcopy Create free account
hub / github.com/NVIDIA/gpu-operator / transformHostRootVolume

Function transformHostRootVolume

controllers/object_controls.go:846–867  ·  view source on GitHub ↗
(obj *appsv1.DaemonSet, hostRoot string)

Source from the content-addressed store, hash-verified

844}
845
846func transformHostRootVolume(obj *appsv1.DaemonSet, hostRoot string) {
847 containsHostRootVolume := false
848 for _, volume := range obj.Spec.Template.Spec.Volumes {
849 if volume.Name == "host-root" {
850 volume.HostPath.Path = hostRoot
851 containsHostRootVolume = true
852 break
853 }
854 }
855
856 if !containsHostRootVolume {
857 return
858 }
859
860 for index := range obj.Spec.Template.Spec.InitContainers {
861 setContainerEnv(&(obj.Spec.Template.Spec.InitContainers[index]), HostRootEnvName, hostRoot)
862 }
863
864 for index := range obj.Spec.Template.Spec.Containers {
865 setContainerEnv(&(obj.Spec.Template.Spec.Containers[index]), HostRootEnvName, hostRoot)
866 }
867}
868
869func transformHostDevCharVolume(obj *appsv1.DaemonSet, hostRoot string) {
870 for _, volume := range obj.Spec.Template.Spec.Volumes {

Callers 1

transformForHostRootFunction · 0.85

Calls 1

setContainerEnvFunction · 0.85

Tested by

no test coverage detected