(obj *appsv1.DaemonSet, hostRoot string)
| 844 | } |
| 845 | |
| 846 | func 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 | |
| 869 | func transformHostDevCharVolume(obj *appsv1.DaemonSet, hostRoot string) { |
| 870 | for _, volume := range obj.Spec.Template.Spec.Volumes { |
no test coverage detected