@@ -173,10 +173,7 @@ func (s *csiNodeSyncer) ensureContainersSpec() []corev1.Container {
173
173
healthPortArg ,
174
174
},
175
175
)
176
- // livenessprobe sidecar container inherits securityContext defined at NodeServer pod level
177
- if livenessProbe .SecurityContext == nil {
178
- livenessProbe .SecurityContext = & corev1.SecurityContext {}
179
- }
176
+
180
177
fillSecurityContextCapabilities (livenessProbe .SecurityContext )
181
178
livenessProbe .ImagePullPolicy = s .getCSINodeDriverRegistrarPullPolicy ()
182
179
livenessProbe .Resources = getSidecarResourceRequests (s .driver , constants .LivenessProbe )
@@ -219,6 +216,10 @@ func (s *csiNodeSyncer) getEnvFor(name string) []corev1.EnvVar {
219
216
Name : "CSI_ENDPOINT" ,
220
217
Value : constants .CSINodeEndpoint ,
221
218
},
219
+ {
220
+ Name : "COS_CSI_MOUNTER_SOCKET" ,
221
+ Value : constants .COSCSIMounterSocketPath ,
222
+ },
222
223
envVarFromField ("KUBE_NODE_NAME" , "spec.nodeName" ),
223
224
}
224
225
@@ -270,13 +271,12 @@ func (s *csiNodeSyncer) getVolumeMountsFor(name string) []corev1.VolumeMount {
270
271
MountPath : "/host/var/log" ,
271
272
},
272
273
{
273
- Name : "coscsi-socket" ,
274
- MountPath : "/var/lib/coscsi.sock" ,
275
- ReadOnly : false ,
274
+ Name : "coscsi-socket-path" ,
275
+ MountPath : "/var/lib/coscsi-sock" ,
276
276
},
277
277
{
278
- Name : "coscsi-mounter-config" ,
279
- MountPath : "/var/lib/cos-csi " ,
278
+ Name : "coscsi-mounter-config-path " ,
279
+ MountPath : "/var/lib/coscsi-config " ,
280
280
},
281
281
}
282
282
@@ -312,8 +312,8 @@ func (s *csiNodeSyncer) ensureVolumes() []corev1.Volume {
312
312
ensureVolume ("fuse-device" , ensureHostPathVolumeSource ("/dev/fuse" , "" )),
313
313
ensureVolume ("log-dev" , ensureHostPathVolumeSource ("/dev/log" , "" )),
314
314
ensureVolume ("host-log" , ensureHostPathVolumeSource ("/var/log" , "" )),
315
- ensureVolume ("coscsi-socket" , ensureHostPathVolumeSource ("/var/lib/coscsi. sock" , "Socket " )),
316
- ensureVolume ("coscsi-mounter-config" , ensureHostPathVolumeSource ("/var/lib/cos-csi " , "DirectoryOrCreate" )),
315
+ ensureVolume ("coscsi-socket-path " , ensureHostPathVolumeSource ("/var/lib/coscsi- sock" , "Directory " )),
316
+ ensureVolume ("coscsi-mounter-config-path " , ensureHostPathVolumeSource ("/var/lib/coscsi-config " , "DirectoryOrCreate" )),
317
317
}
318
318
}
319
319
@@ -357,6 +357,9 @@ func ensureHostPathVolumeSource(path, pathType string) corev1.VolumeSource {
357
357
}
358
358
359
359
func fillSecurityContextCapabilities (sc * corev1.SecurityContext , add ... string ) {
360
+ if sc == nil {
361
+ sc = & corev1.SecurityContext {}
362
+ }
360
363
sc .Capabilities = & corev1.Capabilities {
361
364
Drop : []corev1.Capability {"ALL" },
362
365
}
0 commit comments