Skip to content

Commit b6415af

Browse files
authored
Merge pull request #277 from iPraveenParihar/fix/missing-additional-volume-mount
csi: fix missing additional volumeMounts in nodeplugin container
2 parents ccd76f5 + 9e0f070 commit b6415af

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

internal/controller/driver_controller.go

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1259,7 +1259,15 @@ func (r *driverReconcile) reconcileNodePluginDeamonSet() error {
12591259
utils.PodNamespaceEnvVar,
12601260
},
12611261
VolumeMounts: utils.Call(func() []corev1.VolumeMount {
1262-
mounts := []corev1.VolumeMount{
1262+
mounts := append(
1263+
// Add user defined volume mounts at the start to make sure they do not
1264+
// overwrite built in volumes mounts.
1265+
utils.MapSlice(
1266+
pluginSpec.Volumes,
1267+
func(v csiv1.VolumeSpec) corev1.VolumeMount {
1268+
return v.Mount
1269+
},
1270+
),
12631271
utils.HostDevVolumeMount,
12641272
utils.HostSysVolumeMount,
12651273
utils.HostRunMountVolumeMount,
@@ -1269,7 +1277,7 @@ func (r *driverReconcile) reconcileNodePluginDeamonSet() error {
12691277
utils.CsiConfigVolumeMount,
12701278
utils.PluginMountDirVolumeMount(kubeletDirPath),
12711279
utils.PodsMountDirVolumeMount(kubeletDirPath),
1272-
}
1280+
)
12731281
if ptr.Deref(pluginSpec.EnableSeLinuxHostMount, false) {
12741282
mounts = append(mounts, utils.EtcSelinuxVolumeMount)
12751283
}

0 commit comments

Comments
 (0)