@@ -37,6 +37,7 @@ import (
37
37
const (
38
38
ownerKey = ".metadata.controller.iaa"
39
39
inicontainerName = "intel-iaa-initcontainer"
40
+ configVolumeName = "intel-iaa-config-volume"
40
41
)
41
42
42
43
// +kubebuilder:rbac:groups=deviceplugin.intel.com,resources=iaadeviceplugins,verbs=get;list;watch;create;update;patch;delete
@@ -97,7 +98,7 @@ func removeInitContainer(ds *apps.DaemonSet, dp *devicepluginv1.IaaDevicePlugin)
97
98
newVolumes := []v1.Volume {}
98
99
99
100
for _ , volume := range ds .Spec .Template .Spec .Volumes {
100
- if volume .Name == "intel-iaa-config-volume" || volume .Name == "sys-bus-dsa" || volume .Name == "sys-devices" || volume .Name == "scratch" {
101
+ if volume .Name == configVolumeName || volume .Name == "sys-bus-dsa" || volume .Name == "sys-devices" || volume .Name == "scratch" {
101
102
continue
102
103
}
103
104
@@ -175,7 +176,7 @@ func addInitContainer(ds *apps.DaemonSet, dp *devicepluginv1.IaaDevicePlugin) {
175
176
176
177
if dp .Spec .ProvisioningConfig != "" {
177
178
ds .Spec .Template .Spec .Volumes = append (ds .Spec .Template .Spec .Volumes , v1.Volume {
178
- Name : "intel-iaa-config-volume" ,
179
+ Name : configVolumeName ,
179
180
VolumeSource : v1.VolumeSource {
180
181
ConfigMap : & v1.ConfigMapVolumeSource {
181
182
LocalObjectReference : v1.LocalObjectReference {Name : dp .Spec .ProvisioningConfig }},
@@ -185,7 +186,7 @@ func addInitContainer(ds *apps.DaemonSet, dp *devicepluginv1.IaaDevicePlugin) {
185
186
for i , initcontainer := range ds .Spec .Template .Spec .InitContainers {
186
187
if initcontainer .Name == inicontainerName {
187
188
ds .Spec .Template .Spec .InitContainers [i ].VolumeMounts = append (ds .Spec .Template .Spec .InitContainers [i ].VolumeMounts , v1.VolumeMount {
188
- Name : "intel-iaa-config-volume" ,
189
+ Name : configVolumeName ,
189
190
MountPath : "/idxd-init/conf" ,
190
191
})
191
192
}
@@ -219,7 +220,7 @@ func provisioningUpdate(ds *apps.DaemonSet, dp *devicepluginv1.IaaDevicePlugin)
219
220
found := false
220
221
221
222
for _ , container := range ds .Spec .Template .Spec .InitContainers {
222
- if container .Name == "intel-iaa-initcontainer" {
223
+ if container .Name == inicontainerName {
223
224
if container .Image != dp .Spec .InitImage {
224
225
update = true
225
226
}
@@ -231,7 +232,7 @@ func provisioningUpdate(ds *apps.DaemonSet, dp *devicepluginv1.IaaDevicePlugin)
231
232
}
232
233
233
234
for _ , volume := range ds .Spec .Template .Spec .Volumes {
234
- if volume .Name == "intel-iaa-config-volume" && volume .ConfigMap .Name != dp .Spec .ProvisioningConfig {
235
+ if volume .Name == configVolumeName && volume .ConfigMap .Name != dp .Spec .ProvisioningConfig {
235
236
update = true
236
237
237
238
break
0 commit comments